Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想通过 C# 中的代码滚动 gridview。当我添加一行时,gridview 显示最后一行。我用这个:
dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[1];
但不能正常工作。
您可以尝试使用此解决方案,只要 AutoSizeRowsMode 属性未设置为 DisplayedCells,它就可以正常工作:
dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.Rows.count-1;