Quantcast
Channel: Active questions tagged listview - Stack Overflow
Viewing all articles
Browse latest Browse all 611

Firemonkey TListview linked to dataset refresh issue

$
0
0

In Delphi 12.0, I'm using Firemonkey TListview.

I link a dataset to it so the contents show the dataset correctly.However if I modify a record it will not update the changed row in TListview.

aDataset.Refresh - does not work

LinkFillControlToField.Active := False / True works but as dataset is big, it takes too long to refresh the entire Listview

Listview.Repaint - does not work

Listview.Items[ItemIndex].Invalidate - does not work as it merely marks it invalidate for future painting. I don't see any more methods for TListviewItem for refresh purpose.

I know one way is to set each of the items in TListviewItem to my dataset manually.

However, I'm using dynamic mode, so it is difficult to have to code each TListviewaccording to different item names (in the TListviewItem) to set to the record data all over again. Think 20-30 TListview and it already starts to feel like never-ending code.

Is there a more elegant solution that can force TListview to re-draw just that one single TListviewItem row that changed? (I know the ItemIndex as I can record it before I edit the row)


Viewing all articles
Browse latest Browse all 611

Trending Articles



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