New to Telerik UI for .NET MAUI? Start a free 30-day trial

.NET MAUI Entry Text Selection

The Entry supports a number of settings for managing the selection of its input text.

The text selection properties provided by the Entry are:

  • CursorPosition(int)—Specifies the starting position of the selected text in the entry.

  • SelectionLength(int)—Specifies the number of characters in the current Entry selection.

  • SelectionOnFocus(Telerik.Maui.SelectionOnFocus)—Specifies the text selection behavior when the Entry control receives focus. The available options are:

    • Unchanged—the selection will not be modified.
    • CursorAtStart—the cursor will be moved at the start of the text.
    • CursorAtEnd—the cursor will be moved at the end of the text.
    • SelectAll—the whole text will be selected.

The following snippet shows how to use the SelectionOnFocus property to preselect the Entry text as soon as the control receives focus:

<telerik:RadEntry x:Name="entry"
                  Text="some text here"
                  SelectionOnFocus="SelectAll" />

See Also

In this article