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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Key Capturing & Handling

Thread ID:





124698 Jun 23,2016 08:31 AM UTC Jun 29,2016 04:05 AM UTC WPF 3
Tags: GridControl
Marco Studer
Asked On June 23, 2016 08:31 AM UTC

I am trying to capture the arrow keys in order to increment my data by a certain value. This works perfectly well using CurrentCellPreviewKeyDown. However, the arrow keys are also used for navigation. I am setting Handled = true after I captured the arrow keys but still the navigation does not stop.

How do I handle these keys correctly, so that the selection is not going to move when hitting the arrow keys?

Kanimozhi Bharathi [Syncfusion]
Replied On June 24, 2016 11:54 AM UTC

Hi Marco Studer, 
Thank you for contacting Syncfusion Support. 
You can cancel the navigation while pressing arrow keys in GridControl by using CurrentCellPreviewKeyDown Event of GridControl like below code example 
grid.CurrentCellPreviewKeyDown += grid_CurrentCellPreviewKeyDown; 
void grid_CurrentCellPreviewKeyDown(object sender, GridCellKeyEventArgs args) 
     if(args.Key == Key.Down || args.Key == Key.Up || args.Key == Key.Left || args.Key == Key.Right) 
        args.Cancel = true; 
Kanimozhi B 

Marco Studer
Replied On June 28, 2016 10:05 AM UTC

Thank you very much, work like a charm!

Kanimozhi Bharathi [Syncfusion]
Replied On June 29, 2016 04:05 AM UTC

Hi Marco Studer, 
Thank you for your update. 
Kanimozhi B 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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