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

delete row by key on a grid

Thread ID:

Created:

Updated:

Platform:

Replies:

51775 Nov 14,2006 08:10 AM UTC Jan 12,2009 06:15 AM UTC WinForms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 14, 2006 08:10 AM UTC

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 ?

Thanks
0L

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

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,
Haneef

Omry Levy
Replied On November 14, 2006 04:43 PM UTC

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 06:15 AM UTC

Hi Julie,

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

http://www.syncfusion.com/support/forums/message.aspx?MessageID=51775

Regards,
Jisha


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.

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

;