Select a datagridview row select using enter key

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, Im using VS 2005 and winforms
I need to select a row in the datagridview, but clicking the enter key,
because our customer says that for him is more simple to use the enter key
instead the mouse
The problem is to find the event that I need, is an event to fire this?
Regards
Julio
 
You can try catching the KeyDown event and select the row there if it
is the Enter that is pressed.

void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.dataGridView1.CurrentRow.Selected = true;
e.Handled = true;
}
}

==================
Clay Burch
Syncfusion, Inc.
 
Back
Top