How do I prevent the BACKSPACE key from deleting the contents of the cell

I have tried the snippet below, but it only works for the DELETE key, it does not work for the backspace key. I have even tried
e.Inner.KeyCode == Keys.Back but that doesn't work either.

private void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyEventArgs e)
{
//log.Warn(e.Inner.KeyData);
//do not allow delete key to delete contents of cell
if (e.Inner.KeyData == Keys.Delete || e.Inner.KeyData == Keys.Back)
{
e.Inner.Handled = true;
return;
}
}

1 Reply

HA haneefm Syncfusion Team April 16, 2007 06:56 PM UTC

Hi James,

We were not able to reproduce the issue here. Is it possible for you to upload us a sample or modify the GGCKeyBackSpace.zip sample to reproduce the issue here? This will help us to analyse the issue further.

Best regards,
Haneef

Loader.
Up arrow icon