I am using DevExpress TcxGrid in Delphi 2009 application (that's right, 100 years old IDE) and I have the following call stack (from madExcept):
SplendidSoft.exe SplendidDMU 1051 +3 TSplendidDM.ImportedDataCSAfterScroll
SplendidSoft.exe DB TDataSet.DoAfterScroll
SplendidSoft.exe DB TDataSet.First
SplendidSoft.exe cxDBData 2056 +21 TcxDBDataProvider.First
SplendidSoft.exe cxCustomData 7638 +17 LoadData
SplendidSoft.exe cxCustomData 7689 +6 TcxCustomDataController.LoadStorage
SplendidSoft.exe cxDBData 4943 +3 TcxDBDataController.LoadStorage
SplendidSoft.exe cxCustomData 7893 +20 TcxCustomDataController.UpdateStorage
SplendidSoft.exe cxCustomData 7991 +16 TcxCustomDataController.DataChanged
SplendidSoft.exe cxCustomData 11107 +2 TcxCustomDataProvider.DataChanged
SplendidSoft.exe cxDBData 1459 +53 TcxDBDataLink.DataSetChanged
SplendidSoft.exe DB TDataLink.DataEvent
SplendidSoft.exe cxDBData 1399 +1 TcxDBDataLink.DataEvent
SplendidSoft.exe DB TDataSource.NotifyLinkTypes
SplendidSoft.exe DB TDataSource.NotifyDataLinks
SplendidSoft.exe DB TDataSource.DataEvent
SplendidSoft.exe DB TDataSet.DataEvent
SplendidSoft.exe DBClient TCustomClientDataSet.DataEvent
SplendidSoft.exe DB TDataSet.Resync
SplendidSoft.exe DB TDataSet.Post
SplendidSoft.exe DBClient TCustomClientDataSet.Post
SplendidSoft.exe DB TDataSet.CheckBrowseMode
SplendidSoft.exe SplendidFormU 295 +4 TSplendidForm.cxButton2Click
cxButton2Click simply calls Post on the underlying dataset and one can see that this simple post initiated the chain of events that leads to the full reload of data and hence - multiple AfterScroll events.
Why it is so? Post just saves all the data that are already in the current record/cells of the grid, so, there is no need to reload even the single record. But TcxDBDataProvider reloads entire dataset, why it is so and how to prevent it? Is this the standard behaviour of the TcxGrid? And why it is so strange?