Vcl.ListActns.TCustomVirtualListAction.OnGetItem

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnGetItem: TGetVirtualItemEvent read FOnGetItem write FOnGetItem;

C++

__property TGetVirtualItemEvent OnGetItem = {read=FOnGetItem, write=FOnGetItem};

Properties

Type Visibility Source Unit Parent
event public
Vcl.ListActns.pas
Vcl.ListActns.hpp
Vcl.ListActns TCustomVirtualListAction

Description

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

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.

See Also