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

# TListControlItems.OnCompare

Event handler signalled to sort the collection using the data in the collection items.

## Declaration

Source position: comboex.pas line 115

`published property TListControlItems.OnCompare : TListCompareEvent read FOnCompare write FOnCompare;`

## Description

OnCompare is a TListCompareEvent property with the event handler signalled to sort the collection using the arbitrary data stored in each collection item. Applications must implement and assign an object procedure using the signature in TListCompareEvent to allow responding to the event notification.

OnCompare is signalled in the DoOnCompare method. Set the value in SortType to stData to enable the event handler when the Sort method is called. Use the CustomSort method to sort the collection using a TListItemsCompare routine.

## See also

TListControlItems.DoOnCompare |  | Signals the OnCompare event handler to compare items in the collection.
TListControlItems.SortType |  | Determines the comparison mechanism used for collection items in the Sort method.
TListControlItems.Sort |  | Performs the Sort routine required for the setting in SortType.
TListControlItems.CustomSort |  | Performs a custom sort using the specified routine.
TListCompareEvent |  | Specifies a function type used to compare items in TComboEx.
TListItemsCompare |  | Specifies a function type used to compare items in TComboEx.
TListItemsSortType |  | Alias to the TSortType in ComCtrls.pp