It's possible to perform autoscroll when I add value to a cell below last visible row on form? I cannot find any autoscroll properties in DataGridView. Is the only possible way to do this to find index of the last visible cell and change FirstDisplayedScrollingRowIndex?
You can use the FirstDisplayedCell
property to make that cell displayed.
Since you know which cell you added the value to, you can do it like this:
dataGridView1.FirstDisplayedCell = yourCell
Can try this,
gv.FirstDisplayedCell = gv.Rows[gv.Rows.Count - 1].Cells[0];
These 3 lines are really equivalent to an auto scroll down
System.Int16 i_NotDisplayableRowCount = dataGridView1.RowCount - dataGridView1.DisplayedRowCount(false); // false means partial rows are not taken into acount
if (i_NotDisplayableRowCount > 0)
dataGridView1.FirstDisplayedScrollingRowIndex = i_NotDisplayableRowCount;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With