SortOrder Property (ListView Control)

       

Returns or sets a value that determines whether ListItem objects in a ListView control are sorted in ascending or descending order.

Syntax

object.SortOrder [= integer]

The SortOrder property syntax has these parts:

Part Description
object An object expression that evaluates to a ListView control.
integer An integer specifying the type of sort order, as described in Settings.

Settings

The settings for integer are:

Constant Value Description
lvwAscending 0 (Default) Ascending order. Sorts from the beginning of the alphabet (A-Z) or the earliest date. Numbers are sorted as strings, with the first digit determining the initial position in the sort, and subsequent digits determining sub-sorting.
lvwDescending 1 Descending order. Sorts from the end of the alphabet (Z-A) or the latest date. Numbers are sorted as strings, with the first digit determining the initial position in the sort, and subsequent digits determining sub-sorting.

Remarks

The Sorted property must be set to True before a list will be sorted in the order specified by SortOrder.