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
close icon

The escape key press down is being set to handled somewhere inside the control

I am trying to handle the KeyDown event when the escape key is pressed outside of the Grid on the main View that contains the Grid.  However, my event handler inside of the view is not getting fired when i press escape and the grid has focus.  I am assuming the handled flag is getting set somewhere inside of the grid preventing the event from bubbling up to the main view. Is there anyway to disable this functionality?  

3 Replies

DR Deepak Raj Sundar Syncfusion Team August 26, 2014 06:08 PM UTC

Thank you for using syncfusion products. We have analyzed your query, PrivewKeyDown event is not called while pressing escape key and grid is having focus. This is happening because when the grid is having focus , and on edit mode, pressing escape will be handled by the Grid's PreviewKeyDown  and keyDown events. In edit mode , Escape key will have different functionality of disabling the edit mode for the current cell. you can override the grid's KeyDown event to meet your requirement . please refer the code snippet :

this.grid.PreviewKeyDown+=grid_PreviewKeyDown;

 private void grid_PreviewKeyDown(object sender, KeyEventArgs e)

        {

            if (e.Key == Key.Escape)

            {

                Console.WriteLine("KeyDown with escape key is handled");

            }

            else Console.WriteLine("Key down without esc is handled");

 

        }


if you still want the escape key to be handled in main view's keydown event, we can provide a work around sample.

Please let us know if you have any queries.

Regards,
Deepak raj Sundar.


KM Kyle MacDonald August 27, 2014 01:17 PM UTC

Hello Deepak,

Thank you for your response.  Yes I am actually looking to handle the escape key press from the view that contains the Grid.  One requirement is that it has to be the KeyDown event and not the PreviewKeyDown.  Any Ideas? 

Thanks,
Kyle


DR Deepak Raj Sundar Syncfusion Team September 3, 2014 12:51 PM UTC

Hai Kyle,
We were able to reproduce the problem  and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let me know if you have any questions

Regards,
Deepak raj Sundar.

Loader.
Live Chat Icon For mobile
Up arrow icon