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

Handling KeyUp Event in the Form

Thread ID:





12505 Apr 1,2004 04:39 AM UTC Apr 1,2004 10:01 PM UTC WinForms 2
Tags: GridControl
Michael Beecham
Asked On April 1, 2004 04:39 AM UTC

I have an issue where I need to implement keyboard shortcuts for form controls (buttons) using the the Control Key (eg Ctrl + F4). My problem is that even though I have set KeyPreview = true for my form all I get back for the KeyUp event is the Control Key Up when I do Ctrl + F4, when the syncfusion grid has focus. When any other controls have focus I get, as expected, the F4 up with the KeyEventArgs property control = true. Is it possible to get the Syncfusion grid to give me the event F4 KeyUp with Control = true. Many thanks, Mike

Administrator [Syncfusion]
Replied On April 1, 2004 09:17 AM UTC

Is the problem only when the grid has an actively editing current cell? When I tried a little sample, as long as the currentcell control did not have the input focus, pressing ctl+F4 was got to the Form1_KeyUp with the parameter set as you descibed above, e.COntrol being true. Is this what you see? Now with the embedded cell control having input focus, then the embedded control has control of the keys, and they are not getting passed back to the form. One way you can handle this is to subscribe to the grid''s gridControl1_CurrentCellKeyUp event, and check e.Control && (e.KeyCode == Keys.F4) there. You could even call your form''s keyup handler at that point. To avoid the form''s keyup being called twice when the current cell was not editing, the code includes a ckeck for this case.
private void gridControl1_CurrentCellKeyUp(object sender, KeyEventArgs e)
	if(e.Control && (e.KeyCode == Keys.F4) && this.gridControl1.CurrentCell.IsEditing)
		this.Form1_KeyUp(sender, e);

Michael Beecham
Replied On April 1, 2004 10:01 PM UTC

Thankyou for the response. I really hoping there was a was just a flag I could set. I guess I''ll have to go for that solution. Many thanks for taking the time to respond. Mike


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

Live Chat Icon For mobile
Live Chat Icon