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.

delete row by key on a grid

Thread ID:





51775 Nov 14,2006 03:10 AM Jan 12,2009 01:15 AM Windows Forms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On November 14, 2006 03:10 AM

Hi there,

I have a grid on a form very simple, and by selecting a row and pressing the delete key the row get's deleted.

I didnt do anything to get this behaviour !!!
How can i disable the delete of a row by pressing the delete key, or if that isn't possible disable all keys on the grid ?


Administrator [Syncfusion]
Replied On November 14, 2006 04:22 AM

Hi OL,

Issue 1: For GridControl DeleteKey.

To disable the DeleteKeyBehavior in a grid, you can handle the CurrentCellKeyDown and set the e.Handled to TRUE. Here is a code snippet

private void gridControl1_CurrentCellKeyDown(object sender, KeyEventArgs e)
if( e.KeyCode == Keys.Delete )
GridControl grid = sender as GridControl;
GridCurrentCell cc = grid.CurrentCell;
if(!cc.IsEditing )
e.Handled = true;

Issue 2: DataBound DeleteKey

Try setting the EnableRemove property of the grid to FALSE. Below is a code snippet.

this.grid.EnableRemove = false.

Best Regards,

Omry Levy
Replied On November 14, 2006 11:43 AM

Thanks worked like a charm.

Could you consider adding the following:

1) a delete permission on the grid as a whole

2) keyboard disable on the grid as a whole

Jisha Joy [Syncfusion]
Replied On January 12, 2009 01:15 AM

Hi Julie,

Please use the following link for the forum thread that dicusses the same issue.




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.