我的winform程序中,遍历datagridview中的行,找到后定位到该行,可是滚动条并不滚动,这样就看不到定位的行,怎么办。
我的定位语句是这样的;
DGV_DW.Rows[i].Selected = true; //datagridview中该行是被选中了,可是滚动条没有跟着滚动下来啊,由于数据量大,怎么使滚动条也滚下来让人看到啊。
我的定位语句是这样的;
DGV_DW.Rows[i].Selected = true; //datagridview中该行是被选中了,可是滚动条没有跟着滚动下来啊,由于数据量大,怎么使滚动条也滚下来让人看到啊。
DGV_DW.currentcell=DGB_DW.rows[i].cell[0];
你的代码不有dataGridView1.Rows[i].Selected = true;
这句写在哪的。。然后加一句就行了。
dataGridView1.Rows[i].Selected = true;
dataGridView1.CurrentCell = dataGridView1.Rows[i].Cells[0];
DGV_DW.Rows[i].Selected = true;
DGV_DW.CurrentCell = dataGridView1.Rows[i].Cells[0];