Table of Contents

Property SortDescriptions

Namespace
Alternet.UI
Assembly
Alternet.UI.dll

SortDescriptions

Collection of Sort criteria to sort items in this view over the inner IBindingList.

public override SortDescriptionCollection SortDescriptions { get; }

Property Value

SortDescriptionCollection

Remarks

If the underlying SourceCollection only implements IBindingList, then only one sort criteria in form of a SortDescription can be added, specifying a property and direction to sort by. Adding more than one SortDescription will cause a InvalidOperationException. One such class is Generic BindingList

Classes like ADO's DataView (the view around a DataTable) do implement IBindingListView which can support sorting by more than one property and also filtering CustomFilter

Some IBindingList implementations do not support sorting; for those this property will return an empty and immutable / read-only SortDescription collection. Attempting to modify such a collection will cause NotSupportedException. Use CanSort property on this CollectionView to test if sorting is supported before modifying the returned collection.