RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomListView.OwnerDataFind Method

Searches for an item in the list view control.

Pascal
function OwnerDataFind(Find: TItemFind; const FindString: string; const FindPosition: TPoint; FindData: TCustomData; StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean): Integer; virtual;
C++
virtual __fastcall int OwnerDataFind(TItemFind Find, const AnsiString FindString, const TPoint FindPosition, TCustomData FindData, int StartIndex, TSearchDirection Direction, Boolean Wrap);

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. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!