New to Telerik UI for .NET MAUI? Start a free 30-day trial
Selecting All Text in Edit Mode in DataGrid for UI for .NET MAUI
Updated on Dec 16, 2025
Environment
| Version | Product | Author |
|---|---|---|
| 12.0.0 | Telerik UI for .NET MAUI DataGrid | Dobrinka Yordanova |
Description
I want to select all text in a cell when entering edit mode in the DataGrid for UI for .NET MAUI, but I can't figure out how to accomplish this.
This knowledge base article also answers the following questions:
- How to use
SelectionOnFocusproperty inRadEntryfor DataGrid editing? - How to select text automatically in edit mode in DataGrid?
- How to set implicit style for
RadEntryin DataGrid?
Solution
To select all text in a cell during edit mode, set the SelectionOnFocus property of the RadEntry editor to SelectAll. Use an implicit style for the RadEntry to apply this property.
- Define an implicit style for
RadEntryin theContentPage.Resourcessection. - Set the
SelectionOnFocusproperty toSelectAllwithin the style. - Use the
RadDataGridwithUserEditModeset toCell.
Here is an example implementation:
xml
<ContentPage.Resources>
<ResourceDictionary>
<Style TargetType="telerik:RadEntry">
<Setter Property="SelectionOnFocus" Value="SelectAll" />
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<Grid RowDefinitions="Auto,*" Padding="12">
<telerik:RadDataPager x:Name="Pager"
Source="{Binding Items}"
PageSize="10"
Grid.Row="0"/>
<telerik:RadDataGrid Grid.Row="1" x:Name="grid"
ItemsSource="{Binding PagedSource, Source={x:Reference Pager}}"
AutoGenerateColumns="False"
UserEditMode="Cell">
<telerik:RadDataGrid.Columns>
<telerik:DataGridTextColumn PropertyName="Id" HeaderText="ID" CanUserEdit="True"/>
<telerik:DataGridTextColumn PropertyName="Name" HeaderText="Name" CanUserEdit="True"/>
<telerik:DataGridTextColumn PropertyName="Category" HeaderText="Category" CanUserEdit="False"/>
<telerik:DataGridTextColumn PropertyName="Price" HeaderText="Price" CanUserEdit="False"/>
<telerik:DataGridBooleanColumn PropertyName="InStock" HeaderText="In Stock" CanUserEdit="False"/>
</telerik:RadDataGrid.Columns>
</telerik:RadDataGrid>
</Grid>