It's a bit tied up, so carry me.
TDataset.Edit calls SetState(dsEdit); that calls the DataEvent(deUpdateState, 0);
TDataSet.DataEvent when called with the deUpdateState parameter, if you have disabled controls in your dataset, it sets a flag that will dispatch the deLayoutChange event when the controls are turned back on, which, according to the documentation, says a bit vaguely that βThe data location in data driven. "
When a control is re-enabled, it is a data-bound grid, this can lead to very expensive flushes, causing the whole grid to be redistributed. In a large dataset with a large number of rows and columns, this can take several seconds, even if you did not do anything while the controls were disabled, which affects the layout of the grid.
Is there any way to prevent this? SetState not virtual. DataEvent is virtual, but the FEnableEvent field that it uses for installation is not available from derived classes. There seems to be no way around this without rude hackers. (RTTI surgery, overlay classes, etc.) Does anyone know how best to do this?
source share