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 ?
AD
Administrator
Syncfusion Team
January 4, 2005 07:02 AM UTC
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 11:17 PM UTC
Thanks... it works !! But may I know what is it doing ?
AD
Administrator
Syncfusion Team
January 5, 2005 07:44 AM UTC
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
June 1, 2007 12:31 AM UTC
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 04:04 PM UTC
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