* * *

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

Alextp

  • Hero Member
  • *****
  • Posts: 683
    • 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"?

GetMem

  • Hero Member
  • *****
  • Posts: 3195
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

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus