RadDataGrid provides a built-in editing functionality, which allows the app users to easily edit the data presented in the grid. Depending on the column data type, a relevant editor allows end users to edit content in a friendly environment.
You would need to define the UserEditMode property of the DataGrid control in order to enable the editing feature.
UserEditMode property is type of DataGridUserSortMode and accepts the following values:
- None: Editing is disabled (by default);
- Cell: Used to enable the editing option.
In addition, you could disable editing for concrete columns separately through the CanUserEdit property of the DataGridColumn class. For more details on this check Columns Overview topic.
Each DataGrid column type provides different editor, so that the content could be edited in a convenient manner according to its value type. Check below the related Xamarin.Forms control for editing the values inside the DataGrid columns:
*TemplateColumn doesn't have support for editing as that column is not bound to any property and the DataGrid has no way of knowing what type of Editor to use or what property to update after edit mode closes.
RadDataGrid provides a few useful commands related to the editing functionality, such as:
- 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 utilize any of the listed commands, go to Editing Commands topic.
You could change the visual appearance of each editor through the CellEditorStyle property of the DataGridColumn. You would need to apply to CellEditorStyle a Xamarin.Forms.Style with TargetType set to the corresponding to each column editor control.
Check below a quick snippet with CellEditorStyle applied to DataGridTextColumn:
<telerikGrid:DataGridTextColumn.CellEditorStyle> <Style TargetType="Entry"> <Setter Property="FontSize" Value="Large"/> <Setter Property="FontAttributes" Value="Bold"/> </Style> </telerikGrid:DataGridTextColumn.CellEditorStyle>