Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

FMX grid behavior 10.1 - 10.2 different

$
0
0

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

20170903_Demo#8


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>