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. Image for the cookie policy date

Is delete a function in the GGC ?? how can i disable it ??

when i click on "delete", the content in GGC clear even there''s no codes inside the sub TableControlCurrentCellKeyDown() If i remove the sub, the problem solved, but I do need to have some coding inside TableControlCurrentCellKeyDown(). How can I disable the delete function ?

5 Replies

AD Administrator Syncfusion Team January 4, 2005 02:02 AM

In your TableControlCurrentCellKeyDown event, if e.Inner.KeyCode equals Keys.Delete, then try setting e.Inner.Handled = true.


AD Administrator Syncfusion Team January 4, 2005 06:17 PM

Thanks... it works !! But may I know what is it doing ?


AD Administrator Syncfusion Team January 5, 2005 02:44 AM

By setting e.Handled to true, you are telling the tableControl not to do further processing on the Delete key. And this prevents the clearing of the cells.


JB James Blibo May 31, 2007 08:31 PM

I want to siable the backspace key from not deleting the contents of the cell, like the delete key, but it is not working...
//do not allow delete key to delete contents of cell
if (e.Inner.KeyCode == Keys.Delete || e.Inner.KeyCode == Keys.Back || e.Inner.KeyData == Keys.Back)
{
e.Inner.Handled = true;
return;
}


HA haneefm Syncfusion Team June 1, 2007 12:04 PM

Hi James,

You can TableControlCurrentCellKeyPress event to set e.Inner.Handled = true for BackSpace key to tell the tableControl not to do further processing on the BackSpace key. And this prevents the deleting of the cell text.

private void gridGroupingControl1_TableControlCurrentCellKeyPress(object sender, GridTableControlKeyPressEventArgs e)
{
if( e.Inner.KeyChar == (char)8 )
e.Inner.Handled = true;
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon