Hello All,
I'm trying to trap the enter key in my dataGrid using the event...
aColumnTextColumn.TextBox.KeyPress += new
KeyPressEventHandler(DateKeyPress);
The event fires when there is a key pressed for the cell except for the
Enter key. Apparently this key doesn't fire this event. My event code is...
private void DateKeyPress(object sender, KeyPressEventArgs e)
{
Console.WriteLine(e.KeyChar);
switch ((char)(e.KeyChar))
{
case '\r': //Enter key
e.Handled = true;
break;
default: // Everything else
e.Handled = false;
break;
}
}
When I modify a cell's value and press the Enter key, my break point on the
e.Handled = true; for case '\r': doesn't even hit. Can someone tell me what
I'm doing wrong?
Thanks