C# 用C语言实现网格滚动#

C# 用C语言实现网格滚动#,c#,gridview,scroll,row,C#,Gridview,Scroll,Row,我想要用C#按代码滚动gridview。当我添加一行时,gridview显示最后一行。我用了这个: dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[1]; 但无法正常工作。您可以尝试使用此解决方案,只要AutoSizeRowsMode属性未设置为DisplayedCells,此解决方案就可以正常工作: dataGridView1.FirstDisplayedScrollingRow

我想要用C#按代码滚动gridview。当我添加一行时,gridview显示最后一行。我用了这个:

dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[1];

但无法正常工作。

您可以尝试使用此解决方案,只要AutoSizeRowsMode属性未设置为DisplayedCells,此解决方案就可以正常工作:

dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.Rows.count-1;

你试过集中注意力吗?