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
close icon

Editing cell value with Delete key

Hi,
I am using a GridDataBoundGrid, and editing the cell value for a column with text box.

I want to clear the TextValue of the textbox for the cell in edit mode if the delete key is pressed. How to do that?

Also the KeyDown event handler for GridDataBoundGrid is not triggering when Delete key is pressed.

Please reply soon.


1 Reply

RC Rajadurai C Syncfusion Team December 18, 2008 07:13 AM UTC

Hi Champak,

Thanks for your interest in Syncfusion products.

Please try handling the CurrentCellKeyDown event with following code snippet.

void gridDataBoundGrid1_CurrentCellKeyDown(object sender, KeyEventArgs e)
{
GridCurrentCell cc = this .gridDataBoundGrid1 .CurrentCell;
if (e.KeyCode == Keys.Delete)
{
if (cc.Renderer is GridTextBoxCellRenderer)
this.gridDataBoundGrid1[cc.RowIndex, cc.ColIndex].CellValue = null;
}
}


Regards,
Rajadurai


Loader.
Live Chat Icon For mobile
Up arrow icon