By default, in the SfDataGrid on pressing the Enter key, the currentcell is moved to the next row when NavigationMode is Cell. You can change this behavior like Tab key navigation that moves the currentcell to next cell of the same row by overriding the GridSelectionController.
The following code example shows you how to override the GridSelectionController.
To customize the Enter key behavior, you need to override the ProcessKeyDown method in GridSelectionController. In this method, you can change the Enter key behavior like Tab key by changing the Enter KeyEventArgs to Tab KeyEventArgs and also you can assign the state of Tab key event handling args to Enter key event handling args.
The following code example illustrates how to change the Enter KeyEventArgs into Tab KeyEventArgs in ProcessKeyDown method.
The following code example shows you how to set the instance of above GridSelectionControllerExt that is derived from GridSelectionController to SfDataGrid.SelectionController property.
You can refer to the following sample to change the Enter key behavior.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||.NET Framework:||Product Version:|