最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

listview - Firemonkey TListview linked to dataset refresh issue - Stack Overflow

programmeradmin5浏览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)

发布评论

评论列表(0)

  1. 暂无评论