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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top