I am binding my grid as such:
dataGridView1.DataSource = new BindingSource();
dataGridView1.DataSource = tableData; (tableData is an ArrayList of custom objects)
The dataSource is getting updated very often (the file it is reading from gets updated about every 2 ms). So when I am scrolling, the scrollbar will jump to it’s original position upon a refresh. I refresh like this:
((CurrencyManager)dataGridView1.BindingContext[tableData]).Refresh(); (this happens once every ~1 second)
How can I scroll without the scroll bar resetting every time the datagridview gets refreshed?
Take a look at this. Although the question is about Winforms DataGrid, the answer is applies to DataGridView. You need to store FirstDisplayedScrollingRowIndex before the reload and restore it after.