Hi YWChan,
one was to do this is to use the DataGrid as a subclass and then override
the ProcessCmdKey method, for example:
class MyDataGrid : DataGrid
{
public MyDataGrid() : base()
{
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(keyData == Keys.Delete)
{
//do processing for delete
//return true to stop the event being raised and deleting
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
}
Hope that answers your question to some level.
Mark.
"ywchan" wrote:
I would like to have a datagrid that can be edited but not delete...
and I have no idea how to capture the del key press event.
Please help, thank!