We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change the Enter key behavior in SfDataGrid?

Platform: WPF |
Control: SfDataGrid |
.NET Framework: 4.5 |
Product Version:

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.

Sample Link: CustomizeEnterKeyBehavior_WPF

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile