How would one catch a delete key, backspace key, control X or other
indication that a user wants to delete the contents of a cell?
I used the example code in MSDN's "How to: Host Controls in Windows Forms
DataGridView Cells" as the basis for a GridDate column, I've created a
column that hosts a calendar control. However, there are times when this
cell must have no date specified and I do that by displaying a blank cell.
So far so good. What I can't figure out is how to go from some value to no
value. What if my user wants to get rid of the entered cell value? I can't
quite seem to figure out how to catch a delete key, backspace or control X
event on this cell. Any suggestions would be appreciated.

Signature
Richard Lewis Haggard
www.Haggard-And-Associates.com
ClayB - 23 Mar 2007 22:30 GMT
You might try the grid's PreviewKeyDown event. This code was hit for
me in that sample when Delete was pressed on a non-editing cell.
void dataGridView1_PreviewKeyDown(object sender,
PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Delete)
{
this.dataGridView1.CurrentCell.Value = null;
}
}
==================
Clay Burch
Syncfusion, Inc.