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

Control in the grid is moved to the next cell when Enter key is pressed.

Thread ID:





48148 Aug 21,2006 01:36 PM UTC Aug 22,2006 05:39 AM UTC WinForms 2
Tags: GridControl
Asked On August 21, 2006 01:36 PM UTC


My windows form contains DataBoundGrid and few buttons. I have assigned one of the button in the form as "AcceptButton" property of the form. When I press ENTER key while the control is focused on one of the gridcell, the control is moved to the next cell of the grid instead of performing accept button click event. How can I invoke AcceptButton click event, when an Enter key is pressed.


Administrator [Syncfusion]
Replied On August 22, 2006 04:34 AM UTC

Hi Ravi,

To raise the click event of the button when the ENTER key is pressed, you need to handle the CurrentCellKeyDown event to call the PerformClick() method for AcceptButton(windows Button Control).

private void gridDataBoundGrid1_CurrentCellKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
if( e.KeyData == Keys.Enter )
e.Handled = true;

//For Normal Windows Button Control

//For GridPushbutton celltype.
GridPushButtonCellRenderer cr = this.gridDataBoundGrid1.CurrentCell.Renderer as GridPushButtonCellRenderer;
if( cr != null)
gridDataBoundGrid1_PushButtonClick( sender,null);

private void gridDataBoundGrid1_PushButtonClick(object sender, GridCellPushButtonClickEventArgs e)
{ MessageBox.Show("Clicked"); }

Let me know if this helps.
Best Regards,

Replied On August 22, 2006 05:39 AM UTC

Thanks Haneef, It works. I have migrated my code from Syncfusion 1.6 version to 4.2 version, with the old version without using your workaround code it works.


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