Set focus to the next cell of datagridview in c#.net
I have a datagridview in windows forms, the default behavior when editing values is that after the edition of a cell, when I press enter, the selected row changes to the next cell. is it possible???
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Shweta LodhaRank #31 · 39.8K reputationPosted Feb 4, 2014, 9:34 AM EST
You can capture KeyDown event and select the row on pressing Enter:
void dataGridView_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.dataGridView.CurrentRow.Selected = true;
e.Handled = true;
}
}