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

.NET MAUI TreeDataGrid Editing

The Telerik UI for .NET MAUI TreeDataGrid provides built-in editing capabilities, which allow users to modify the data presented in the Grid.

Depending on the TreeDataGrid column data type, the TreeDataGrid provides a relevant editor which allows users to edit the content upon double-clicking the desired cell.

Editing Properties

To enable editing in the TreeDataGrid, define the UserEditMode property of the component. UserEditMode is of type Telerik.Maui.Controls.DataGrid.DataGridUserEditMode and accepts the following values:

  • None—(default on Mobile) Editing is disabled.
  • Cell—(default on Desktop) Enables the editing option.

You can also independently disable editing for specific columns through the CanUserEdit property of the TreeDataGridColumn class. For more details, refer to the topic about columns in the .NET MAUI TreeDataGrid.

Column Editors

Each TreeDataGrid column type provides different editor, so that the content can be edited in a convenient manner according to its value type.

The following table lists the integrated .NET MAUI control for editing the values inside the TreeDataGrid columns:

Column Type Editor
TextColumn RadEntry
NumericalColumn RadNumericInput
BooleanColumn RadCheckBox
DateColumn RadDatePicker
TimeColumn RadTimePicker
PickerColumn RadComboBox
TemplateColumn A custom editor by defining CellEditTemplate.

Custom Editors

If the default editors do not suit the scenario you have, create a custom editor for each column by utilizing the CellEditTemplate property of the TreeDataGridColumn. For detailed information on how the CellEditTemplate can be applied, refer to the article about the .NET MAUI TreeDataGrid column cell templates.

Editing Commands

The TreeDataGrid provides the following commands related to the editing functionality:

  • BeginEdit—Provides an entry point just before the editing begins.
  • CancelEdit—Provides an entry point just before the editing is canceled.
  • CommitEdit—Provides an entry point just before the editing is committed.

For detailed information on how to use any of the listed commands, go to the topic about the .NET MAUI TreeDataGrid editing commands.

Styling

You can change the visual appearance of each editor through the CellEditorStyle property of the DataGridColumn. To the CellEditorStyle, apply a Microsoft.Maui.Controls.Style with a TargetType set to the corresponding to each column editor control.

The following snippet shows a CellEditorStyle applied to the TreeDataGridTextColumn.

Additional Resources

See Also

In this article