Vcl.ComCtrls.TCustomListView.OwnerDataFind
Delphi
function OwnerDataFind(Find: TItemFind; const FindString: string; const FindPosition: TPoint; FindData: TCustomData; StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean): Integer; virtual;
C++
virtual int __fastcall OwnerDataFind(TItemFind Find, const System::UnicodeString FindString, const System::Types::TPoint &FindPosition, void * FindData, int StartIndex, TSearchDirection Direction, bool Wrap);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | protected | Vcl.ComCtrls.pas Vcl.ComCtrls.hpp |
Vcl.ComCtrls | TCustomListView |
Description
Searches for an item in the list view control.
Override OwnerDataFind in a descendant class to implement the searching capabilities of a virtual list view control (that is, when OwnerData is true).
OwnerDataFind is called when the virtual list view must find an item; for example, OwnerDataFind is called when a user attempts an incremental search.
Find specifies the type of search to perform (any of ifData, ifPartialString, ifExactString, ifNearest).
FindString specifies the item text to search for. FindString is ignored unless Find contains ifPartialString or ifExactString.
FindPosition specifies the point from which to start the search. FindPosition is ignored unless Find contains ifNearest
FindData specifies the item data to search for. FindData is ignored unless Find contains ifData.
StartIndex specifies the index of the item from which the search should start.
Direction specifies the direction for the search (sdLeft, sdRight, sdAbove, sdBelow, or sdAll).
Wrap specifies whether the search should continue from the start of the list view control if no match is found.
OwnerDataFind should return the index of the found item. If no item is found, OwnerDataFind should return -1.