Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

PagedCollectionView.CanSort Property


Gets a value that indicates whether this view supports sorting.

Namespace:  System.Windows.Data
Assembly:  System.Windows.Data (in System.Windows.Data.dll)

public bool CanSort { get; }

Property Value

Type: System.Boolean
true in all cases.



This implementation always returns true.

Typically, you use this property to test whether the view supports sorting before setting the SortDescriptions property.

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));


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.

Community Additions

© 2015 Microsoft