I have some problem, don't now how to preserve the scroll position in a DataGridView
.
I have over 1000+ rows and scrolling back to edited row is painful. How can I preserve the scroll position and scroll to the edited row after refreshing data?
I have some problem, don't now how to preserve the scroll position in a DataGridView
.
I have over 1000+ rows and scrolling back to edited row is painful. How can I preserve the scroll position and scroll to the edited row after refreshing data?
Save the row index, do your refresh, then set the
FirstDisplayedScrollingRowIndex
property.You can get the current row index before reloading data:
Then after reloading data, you can use either of these options:
CurrentCell
.FirstDisplayedScrollingRowIndex
.Scroll And set current row:
Scroll: