In the SfDataGrid, you can delete the selected row by pressing the Delete key when the SfDataGrid.AllowDeleting is set to true. Likewise, you can delete the selected cell value without entering into the edit mode when the delete key is pressed by deriving a new class from the GridSelectionController. In the customized GridSelectionController, you need to override the ProcessKeyDown virtual method that handles all the key navigations. With the help of the PropertyDescriptorExtensions.SetValue helper method, you can set the cell value as null. Before setting the value, you need to check whether the selected cell value is null as follows.
Refer to the following code example to assign the customized GridSelectionControllerExt to the SfDataGrid.SelectionController to override the existing SelectionController.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||.NET Framework:|