[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TCustomListView.OnData

Event handler signalled to the value(s) for a list item when OwnerData (virtual mode) has been enabled.

## Declaration

Source position: comctrls.pp line 1606

`protected property TCustomListView.OnData : TLVDataEvent read FOnData write FOnData;`

## Description

OnData is a TLVDataEvent property with the event handler signalled to get the values for a list item when OwnerData (virtual mode) has been enabled for the list view control.

An application must implement and assign an object procedure using the signature in TLVDataEvent to respond to the event notification. Arguments passed to the event handler identify the list view control (Sender) and the list item (Item). The Index property in Item is pre-populated with the ordinal position for the requested data. The event handler is responsible for setting values for any of the other properties in Item.

OnData is signalled from the DoGetOwnerData method, and is called when the virtual list item accesses its property values.

When OwnerData is enabled, the Items property is not used. Only the most recently accessed item in ItemIndex is available.

## See also

TCustomListView.OwnerData |  | Enables or disables owner data (virtual) mode for the list view control.
TCustomListView.ItemIndex |  | Ordinal position for the selected list item on the control.
TListItem |  | Represents the items created in TCustomListView and descendants.
TOwnerDataListItem |  | List item class used in a list view control when OwnerData (virtual) mode is enabled.
TOwnerDataListItems |  | Container for the items in a list view control when owner data (virtual) mode is enabled.
TLVDataEvent |  | Specifies an event handler signalled to get the arbitrary data for an item on a list view control.