Text Selection

The following properties are related to the Entry text selection:

  • CursorPosition(int) Specifies the starting position of the text selected in the entry.
  • SelectionLength(int) Specifies the number of characters in the current selection in the entry control.

The next snippet shows how both could be applied in order to preselect part of the Text of the Entry when the control receives the focus:

<StackLayout Orientation="Horizontal">
    <telerikInput:RadEntry x:Name="selectEntry" 
                           Text="select some text" />
    <telerikInput:RadButton Text="Focus" 
                            Clicked="FocusButtonClicked" />
</StackLayout>

And the Clicked event handler:

private void FocusButtonClicked(object sender, System.EventArgs e)
{
    selectEntry.Focus();
    selectEntry.CursorPosition = 7;
    selectEntry.SelectionLength = 9;
}

Entry Text Selection

See Also

In this article
Not finding the help you need?