RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TVirtualListAction.OnGetItem Event

Occurs when the list action needs to supply an item to its client controls.

Pascal
property OnGetItem: TGetVirtualItemEvent;
C++
__property TGetVirtualItemEvent OnGetItem;

Write an OnGetItem event handler to provide the items that the virtual list action supplies to clients. When you set the Active property to True, the virtual list action generates an OnGetItem event for every index from 0 to Count – 1. In the event handler, supply the string value, image, and data that corresponds to the index specified by Index. 

Sender is the list action that is supplying data to client controls. 

Index indicates which item is requested, where 0 is the first item, 1 is the second item and so on up to the index that is one less than the value of 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 is the index of an image associated with the item. If the item is not associated with an image, ImageIndex should return –1. Otherwise, it should return the index of the desired 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 is 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!