This topic has not yet been rated - Rate this topic

PagedCollectionView.SortDescriptions Property

Silverlight

Gets a collection of SortDescription objects that describe how the items in the collection are sorted in the view.

Namespace:  System.Windows.Data
Assembly:  System.Windows.Data (in System.Windows.Data.dll)
public SortDescriptionCollection SortDescriptions { get; }

Property Value

Type: System.ComponentModel.SortDescriptionCollection
A collection of SortDescription objects that describe how the items in the collection are sorted in the view.

Implements

ICollectionView.SortDescriptions

One or more sort criteria can be used, each specifying a property and direction to sort by.

The following code example demonstrates how to add a sort description to the SortDescriptions collection to sort data in a DataGrid display. This example is part of a larger example available in the How to: Group, Sort, and Filter Data in the DataGrid Control topic.


if (taskListView.CanSort == true)
{
    // By default, sort by ProjectName.
    taskListView.SortDescriptions.Add(new SortDescription("ProjectName", ListSortDirection.Ascending));
}


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ