RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomVirtualListAction.GetItem Method

Provides information about a specified item.

Pascal
function GetItem(const Index: Integer; var Value: String; var ImageIndex: Integer; var Data: TCustomData): Boolean;
C++
__fastcall Boolean GetItem(const int Index, AnsiString Value, int ImageIndex, TCustomData Data);

When you set the Active property to True, the virtual list action supplies items to client controls through a series of calls to GetItem, one for each item. GetItem collects the information about each item by generating an OnGetItem event. It returns True if there is an OnGetItem event handler to provide information about the item, which is returned using the GetItem parameters. GetItem returns False if it cannot supply information about the item because there is no OnGetItem event handler. Index indicates which item is desired, where 0 indicates the first item, 1 indicates the second item and so on up to the number of items specified by the Count property. Value returns the string value of the item. This is the text that appears in the client combo box or list box. ImageIndex returns the index of an image associated with the item. If the item is not associated with an image, ImageIndex returns –1. Otherwise, it returns the index of an image in the Images property. Data returns a pointer to application-defined data that is associated with the item. For client controls that store items in a TStrings object, Data supplies the value of the Objects property for the item. 

 

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