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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

57123 Feb 26,2007 02:06 PM Feb 26,2007 04:59 PM Windows Forms 1
loading
Tags: GridControl
Ivan Capin
Asked On February 26, 2007 02:06 PM

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.

Administrator [Syncfusion]
Replied On February 26, 2007 04:59 PM

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

CONFIRMATION

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.

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.

;