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

# TCustomListView.SortColumn

Ordinal position for the column used to sort the list items, or -1 when not assigned.

## Declaration

Source position: comctrls.pp line 1596

`protected property TCustomListView.SortColumn : Integer read FSortColumn write SetSortColumn default - 1;`

## Description

SortColumn is an Integer property with the ordinal position for the column used to sort the list items for the control. The default value for the property is -1, and indicates that an explicit column position has not been assigned.

Changing the value for the property causes the Sort method to be called.

SortColumn is updated in the ColClick method when a column header for the control has been clicked. It also indicates which entry in Columns has the sort indicator when AutoSortIndicator is enabled.

Values in SortType, SortColumn, and SortDirection are passed to the widgetset class when its Handle is allocated or updated.

## See also

TCustomListView.Sort |  | Sorts the values in Items using the SortType, SortColumn, and SortDirection for the control.
TCustomListView.SortDirection |  | Sorting direction (order) for the current SortColumn.
TCustomListView.SortType |  | Specifies the sorting mechanism used for the current SortColumn.
TCustomListView.AutoSort |  | Controls automatic updates to the sort column and order indicator for the control.
TCustomListView.AutoSortIndicator |  | Indicates if the control automatically changes the column and/or order indicator when a column is clicked.