C#实现DataGridView把某行设定为CurrentRow

转载自https://blog.csdn.net/voidfaceless/article/details/81286725

//设定当前行为update_count
dataGridView1.Rows[update_count].Selected = true;
//下面这一行是最关键的,不然永远会回到第一行
dataGridView1.CurrentCell = dataGridView1.Rows[update_count].Cells[0];

如上面的代码所示。

猜你喜欢

转载自blog.csdn.net/Melody1994/article/details/91411673
今日推荐