Recent

Author Topic: ListViewFilterEdit: how to detect original listitem?  (Read 1910 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2399
    • UVviewsoft
ListViewFilterEdit: how to detect original listitem?
« on: January 13, 2018, 01:11:01 pm »
TListViewFilterEdit has filter filled.
Listview is changed.
Listview was filled from "data" [maybe some array].
How can I get original index of listview item, in "data", for focused item of Listview?

Seems, I need to read Caption of focused item. Then search by this caption inside "data"?

balazsszekely

  • Guest
Re: ListViewFilterEdit: how to detect original listitem?
« Reply #1 on: January 13, 2018, 04:10:52 pm »
Use the ListViewFilterEdit.Items.Add(ListItem) method, where the ListItem is a TListViewDataItem:
Code: Pascal  [Select][+][-]
  1.  TListViewDataItem = record
  2.     Data: Pointer;
  3.     StringArray: TStringArray;
  4.     class operator =(a,b : TListViewDataItem) : Boolean;
  5.   end;

You can store any object in Data: Pointer(class instance, Tobjects, records, etc...) including the index of the array for example

 

TinyPortal © 2005-2018