C # DataGridView to achieve a row to CurrentRow

Reprinted from https://blog.csdn.net/voidfaceless/article/details/81286725

// Set the current behavior update_count
dataGridView1.Rows [update_count] = .selected to true ;
// this line is the most critical, otherwise always come back to the first line
dataGridView1.CurrentCell = dataGridView1.Rows [update_count] .Cells [ 0 ];

As shown in the code above.

Guess you like

Origin blog.csdn.net/Melody1994/article/details/91411673