KaxInputControlSelectionOnFocus Property |
Namespace: Kettic.AspNet.Controls
A Kettic.AspNetControls.SelectionOnFocus object that represents the selection on focus in KaxInput control. The default value is "None".
Use this property to provide selection on focus of KaxInput control. You can set one of the following values:
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>