We use a standard TClientDataSet and an FMX-grid for displaying data.
One field is displayed as a CheckColumn, and we need that only one row can have a checked value.
We use OnEditingDone handler of the grid
to uncheck previously selected item.
When OnEditingDone is called we make follow actions:
1) uncheck all other items except one that was just selected;
2) call Locate to move cursor to the selected item.
Calling Locate is required because without it the grid is not
refreshed (it shows previously selected items as selected though
their IsSelectedBool = false).
We don't call dataset's DisableControl/EnabledControl because
othwerise the grid won't be refreshed.
On Berlin the approach works fine.
On Tokyo we get Assert Violation when check any item.
The Assert Violation can be avoided by calling DisableControl/EnabledControl.
But grid is not refreshed after calling DisableControl/EnabledControl
and we can't find a way to refresh it (gr1.Repaint and BindSourceDB1.ResetNeeded
don't help).
So, we need to find a way to make follow actions inside OnEditingDone:
- update list of item in the dataset;
- refresh the grid to dispaly actual state of updated items;
- avoid AV.
Project that show the error