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

Weird enter/esc key handling

Thread ID:





17704 Aug 13,2004 04:20 PM UTC Aug 13,2004 05:23 PM UTC WinForms 2
Tags: GridControl
Daniel Chait
Asked On August 13, 2004 04:20 PM UTC

I placed a GDBG on a modal dialog box with an OK and Cancel button (the Form''s .AcceptButton and .CancelButton are set accordingly). When I''m moving around in the Grid, the Grid seems to take the Enter and Esc keys (ie Enter moves to the next cell and Esc does nothing). However, I have a column of type "ComboBox" and here''s the problem. When the dropdown is shown, the user arrows down to their choice and hits Enter, instead of just making hte choice, the Dialog''s OK button is clicked. Likewise for Esc, it doesn''t just close the dropdown, it actually his the form''s CancelButton. Ideas?

Daniel Chait
Replied On August 13, 2004 04:22 PM UTC

Following up, it''s not only in the ComboBox that is a problem. In a normal textbox field, hitting Esc doesn''t cause a canceledit to happen, instead it closes the Dialog.

Administrator [Syncfusion]
Replied On August 13, 2004 05:23 PM UTC

You can try to handle this by overriding ProcessDialogKey in a derived grid.
public class MyGridDataBoundGrid : GridDataBoundGrid
	protected override bool ProcessDialogKey(Keys keyData)
		if(keyData == Keys.Enter)
			return true;
		if(keyData == Keys.Escape)
			return true;
		return base.ProcessDialogKey (keyData);


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