System.Windows.Forms.ListView.Sorting Property

Gets or sets the sort order for items in the control.

Syntax

[System.ComponentModel.DefaultValue(System.Windows.Forms.SortOrder.None)]
public SortOrder Sorting { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The ListView.Sorting property allows you to specify whether or not items are sorted in the System.Windows.Forms.ListView control. By default, no sorting is performed. When the ListView.Sorting property is set to SortOrder.Ascending or SortOrder.Descending, the items in the System.Windows.Forms.ListView are sorted automatically in ascending alphabetical order (when the property is set to SortOrder.Ascending) or descending alphabetical order (when the property is set to SortOrder.Descending). You can use this property to automatically sort items that are displayed in your System.Windows.Forms.ListView control to make it easier for users to find items when a large number of items are available.

If you want to perform your own item sorting instead of using the ListView.Sorting property, use the ListView.ListViewItemSorter property in combination with the ListView.Sort method.

If the ListView.Sorting property is set to a value other than SortOrder.None or if the ListView.ListViewItemSorter property is set, the list is sorted automatically when items is added. Items are not sorted automatically when the label text changes.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0