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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

prevent cell delete

Thread ID:

Created:

Updated:

Platform:

Replies:

67252 Aug 10,2007 06:29 PM UTC Aug 10,2007 09:09 PM UTC WinForms 1
loading
Tags: GridControl
Michael Sabin
Asked On August 10, 2007 06:29 PM UTC

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 09:09 PM UTC

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.

Warning Icon 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.Close Icon

;