AD
Administrator
Syncfusion Team
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
AcceptButton1.PerformClick();
//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,
Haneef
RA
Ravi
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.