Delete Key DataGrid
I'd like for users to be able to select a row in a datagrid and press the delete key on the keyboard and have the row deleted. I've got the code written to detect what row they're on and update the dataSet... but I don't know how to handle it when they click the delete key?
[278 byte] By [
WWG] at [2007-12-16]
I'm doing this in c#. I'm using the KeyPress event but it throwing an error:
Here's my code:
if(e.KeyChar().Equals(System.Windows.Forms.Keys.Delete))
{
MessageBox.Show("Delete");
}Error:
System.Windows.Forms.KeyPressEventArgs.KeyChar' denotes a property where a method was expected.
Any ideas?
WWG at 2007-9-9 >

Thanks D-Man. That code works some of the time. When I highlight a row in the datagrid, and then press the delete key, the event isn't captured. Seems like I need to override something in the grid.
WWG at 2007-9-9 >
