androidiosdelphifiremonkeytlistview

Delphi TListview - search for item and auto-scroll to that item


Delphi 10.4.1 with FireMonkey.

I have 50 items on a TListView, with IDs from 1 to 50. No code posted here because I don't even know where to get started.

If I did a search for ID=35, is there a way to make TListView move exactly to the position of that item programmatically so that the item is in full view?


Solution

  • This is trivial:

    ListView.ScrollTo(Item.Index);