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

Exiting Edit mode of a row/column''s last cell

Let's say EnterKeyBehavior = GridDirectionType.Right and the current cell is a row's last cell and is in edit mode.

When the enter key is pressed, the current cell not only remains the current cell but also remains in edit mode. That seems to be the default behavior.

How is it possible to exit the edit mode (without changing GridDirectionType) ?

Cheers.

1 Reply

AD Administrator Syncfusion Team February 26, 2007 09:59 PM UTC

Hi Ivan,

You can handle the CurrentCellKeyDown event of the grid and call the CurrentCell.EndEdit() method to finish up editing mode of the grid.

private void gridControl1_CurrentCellKeyDown(object sender, KeyEventArgs e)
{
if( e.KeyData == Keys.Enter)
{
GridControl grid = sender as GridControl;
GridCurrentCell cc = grid.CurrentCell;
if( cc.ColIndex == grid.ColCount && cc.IsEditing )
cc.EndEdit();
}
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon