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 of contents in a GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

88839 Aug 13,2009 06:39 AM UTC Feb 28,2013 06:29 PM UTC ASP.NET Web Forms (Classic) 3
loading
Tags: GridGroupingControl
Priya S
Asked On August 13, 2009 06:39 AM UTC

Hi,

I'm using GridControl object to display some data in a form. But when a row or column header is selected and delete key is pressed, all the data in the selection gets removed. I tried to set some property values and override the keypress event for the current cell. But, I could not stop this from occuring.

Is there anyway i can block the delete operation?

Thanks,
Priya

Jisha Joy [Syncfusion]
Replied On August 18, 2009 10:27 AM UTC

Hi Priya,

The desired behavior can be achieved by handling the KeyDown event of GridControl. See the code:
void gridControl1_KeyDown(object sender, KeyEventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
if (cc.ColIndex == 0 || cc.RowIndex == 0)// Checking for row/column header
{
if (e.KeyCode == Keys.Delete)
{
e.Handled = true;
}
}
}

Thank you for using Syncfusion products.

Regards,
Jisha

Priya S
Replied On August 18, 2009 02:12 PM UTC

Hi,

Thanks a lot. That helped.

I was trying with the current cell key down event and tried to return if the key value was delete. But that never worked.

Thanks again.

Edward Reyes
Replied On February 28, 2013 06:29 PM UTC

We have AllowDelete set to false, AllowMultipleRecordDeletion set to false, AllowSelection set to False and with a LeftShift Key and a Delete Key pressed in combination, the Selected row is still being deleted.  How can all deletions be disabled?  Is this yet another Syncfusion bug that has to get fixed?
 
Ed

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

;