1
votes

I want to display a lot of data in DataGridView (more than 1000 rows and 15 columns). I use BindingList as the DataGridView.DataSource. The BindingList is modified systematically (15s) - some rows are deleted, modified or added (not many, definitely fewer than number of all rows).

Both preparing and displaying DataGridView for the first time and modifying it isn't as efficient as it's needed. I found a simple solution (and a few similar):

bindingList.RaiseListChangedEvents = false;
// modifying BindingList
bindingList.RaiseListChangedEvents = true;
bindingList.ResetBindings();

Since I added these lines, DataGridView is built and refreshed much faster. But this solution has one unacceptable disadvantage. After refreshing list, scroll is moved at the top of list and selection is lost. Is there any solution that not only quickly modify DataGridView but also scroll stay in previous position (before update) and do not change row selection?

1

1 Answers

2
votes

Save selected coordinates and after the refresh, restore them.