Click or drag to resize
KaxInputControlSelectionOnFocus Property
Gets or sets the selection on focus options for the KaxInput control

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public virtual SelectionOnFocus SelectionOnFocus { get; set; }

Property Value

Type: SelectionOnFocus

A Kettic.AspNetControls.SelectionOnFocus object that represents the selection on focus in KaxInput control. The default value is "None".

  • None
  • CaretToBeginning
  • CaretToEnd
  • SelectAll
Remarks

Use this property to provide selection on focus of KaxInput control. You can set one of the following values:

Examples

The following example demonstrates how to set the SelectionOnFocus property from DropDownList:

            </%@ Page Language="C#" /%>  
</%@ Register Assembly="KaxInput.Net2" Namespace="Kettic.AspNetControls" TagPrefix="kaxI" /%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>KaxTextBox selection</title>
<script runat="server">
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue == "CaretToBeginning")
{
this.KaxTextBox1.SelectionOnFocus = Kettic.AspNetControls.SelectionOnFocus.CaretToBeginning;
}
else if (DropDownList1.SelectedValue == "CaretToEnd")
{
this.KaxTextBox1.SelectionOnFocus = Kettic.AspNetControls.SelectionOnFocus.CaretToEnd;
}
else if (DropDownList1.SelectedValue == "SelectAll")
{
this.KaxTextBox1.SelectionOnFocus = Kettic.AspNetControls.SelectionOnFocus.SelectAll;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<kaxI:KaxTextBox SelectionOnFocus="CaretToBeginning" ID="KaxTextBox1" runat="server"></kaxI:KaxTextBox>
<br />
<asp:DropDownList AutoPostBack="true" ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Text="CaretToBeginning">CaretToBeginning</asp:ListItem>
<asp:ListItem Text="CaretToEnd">CaretToEnd</asp:ListItem>
<asp:ListItem Text="SelectAll">SelectAll</asp:ListItem>
</asp:DropDownList></div>
</form>
</body>
</html>
See Also