prevent cell delete

I am using GridDataBoundGrid and have my AllowSelection set to Row and AlphaBlend. I was wondering if there is a way to prevent the delete key from clearing the contents of a cell.

I would like to make it work when the user enters text. I don't want it to set the CellValue to null.

1 Reply

AJ Ajish Syncfusion Team August 10, 2007 09:09 PM UTC

Hi Michael,

Handle the CurrentCellKeyDown(object sender, KeyEventArgs e). Below is some code snippet that handle the Delete key.


public void gridDataBoundGrid1_CurrentCellKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete && !this.gridDataBoundGrid1.CurrentCell.IsEditing)
e.Handled = true;

}

Kindly take a look and let me know if this helps

Regards,
Ajish.

Loader.
Up arrow icon