I'm using a DevExpress XtraGrid component and a DataTable as the data source.
I'd like to update the data (asynchronously) every few seconds but I don't want to scroll/collapse/change the grid.
For example, if a user has scrolled the grid and I perform a background update, then I want the user to stay on the same row, etc.
preguntado el 08 de noviembre de 11 a las 13:11
I think that you can use the following approach:
Utilizan BindingSource as a datasource for GridControl and disable BindingSource.RaiseListChangedEvents option. This will allow you to prevent your datasource from sending notifications to GridControl. As a result, GridControl will not update itself automatically on each change.
On updating your datasource, save updated row indexes.
Finally, introduce a timer with interval equal, for example, five seconds, and call the RefreshRow method to refresh only requiered rows. Also, you can refresh all rows using the RefreshDataSource method.
As a result, you will update only required rows once in five seconds and row states will be saved.