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.
Unfortunately, activation email could not send to your email. Please try again.

Editing cell value with Delete key

Thread ID:

Created:

Updated:

Platform:

Replies:

78553 Dec 18,2008 01:05 AM Dec 18,2008 02:13 AM Windows Forms 1
loading
Tags: GridControl
champak chaini
Asked On December 18, 2008 01:05 AM

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.


Rajadurai C [Syncfusion]
Replied On December 18, 2008 02:13 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;