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

# TCustomListView.SortDirection

Sorting direction (order) for the current SortColumn.

## Declaration

Source position: comctrls.pp line 1597

`protected property TCustomListView.SortDirection : TSortDirection read FSortDirection write SetSortDirection default sdAscending;`

## Description

SortDirection is a TSortDirection property which indicates the sort direction (or order) for the column in the SortColumn property. The value can be sdAscending for ascending sort order, or sdDescending for descending sort order. The default value for the property is sdAscending.

Changing the value for the property causes the Sort method to be called to display the items on the control in the selected sort order.

Use SortType to specify whether the text values, data values, or both are used to sort the list items. Set SortType to stNone to disable sorting in the control. Use SortColumn to set the column number with the values that are sorted.

Use AutoSort and AutoSortIndicator to automatically change the sort column and indicator when a column header is clicked on the control.

## See also

TCustomListView.Sort |  | Sorts the values in Items using the SortType, SortColumn, and SortDirection for the control.
TCustomListView.SortColumn |  | Ordinal position for the column used to sort the list items, or -1 when not assigned.
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.