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

# TListControlItems.DoCustomSort

Performs the comparison for the CustomSort method.

## Declaration

Source position: comboex.pas line 104

`protected function TListControlItems.DoCustomSort(`
`AItem1: TListControlItem;`
`AItem2: TListControlItem`
`):Integer;`

## Arguments

`AItem1` |  | First TListControlItem for the comparison.
`AItem2` |  | Second TListControlItem for the comparison.

## Function result

Relative sort order for the compared items.

## Description

DoCustomSort is an Integer function which performs the comparison for the CustomSort method. Arguments passed to the method contain the TListControlItem instances compared in the method.

DoCustomSort calls the TListItemsCompare routine passed as an argument to the CustomSort method.

The return value contains the relative sort order for the items compared in the method. For example:

<0
  Item1 comes before Item2 using the custom sort.
0
  Item1 and Item2 have the same value in the custom sort.
>0
  Item1 comes after Item2 in the custom sort.

## See also

TListControlItems.CustomSort |  | Performs a custom sort using the specified routine.
TListControlItems.Sort |  | Performs the Sort routine required for the setting in SortType.
TListControlItems.SortType |  | Determines the comparison mechanism used for collection items in the Sort method.
TListControlItems.OnCompare |  | Event handler signalled to sort the collection using the data in the collection items.
TListControlItems.CompareItems |  | Implements a comparison function for items in the collection.
TListItemsCompare |  | Specifies a function type used to compare items in TComboEx.