2015.1.31 DataGridView自动滚动到某行

方法一、dv.CurrentCell = dv.Rows[i].Cells[2] 但此cell不能是隐藏cell

方法二、

if (dgr.Index < dv_sel_aw.FirstDisplayedScrollingRowIndex || dgr.Index > dv_sel_aw.FirstDisplayedScrollingRowIndex+dv_sel_aw.DisplayedRowCount(true))

dv_sel_aw.FirstDisplayedScrollingRowIndex = dgr.Index;

其中FirstDisplayedScrollingRowIndex当前显示界面的最顶端行index

dv_sel_aw.DisplayedRowCount(true)当前界面显示的行数 true表示包括部分行

原文地址:https://www.cnblogs.com/mol1995/p/5964833.html