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.

prevent cell delete

Thread ID:

Created:

Updated:

Platform:

Replies:

67252 Aug 10,2007 02:29 PM Aug 10,2007 05:09 PM Windows Forms 1
loading
Tags: GridControl
Michael Sabin
Asked On August 10, 2007 02:29 PM

I am using GridDataBoundGrid and have my AllowSelection set to Row and AlphaBlend. I was wondering if there is a way to prevent the delete key from clearing the contents of a cell.

I would like to make it work when the user enters text. I don't want it to set the CellValue to null.

Ajish [Syncfusion]
Replied On August 10, 2007 05:09 PM

Hi Michael,

Handle the CurrentCellKeyDown(object sender, KeyEventArgs e). Below is some code snippet that handle the Delete key.


public void gridDataBoundGrid1_CurrentCellKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete && !this.gridDataBoundGrid1.CurrentCell.IsEditing)
e.Handled = true;

}

Kindly take a look and let me know if this helps

Regards,
Ajish.

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.

;