CollectionSourceBase.Sorting Property

Specifies the CollectionSourceBase.Collection's sort settings.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

public IList<SortProperty> Sorting { get; set; }
Public Property Sorting As IList(Of SortProperty)

Property Value

Type Description
IList<SortProperty>

A list of SortProperty objects specifying the collection's sort settings.

When you add/remove the Sorting list items, sorting is immediately applied to the inner collection. Do not add several elements one after another. Instead, populate a temporary SortProperty list and then assign it to Sorting. The example below is taken from the ListView.LoadModelCore method implementation.

List<SortProperty> sorting = new List<SortProperty>();
foreach(IModelSortProperty sortProperty in Model.Sorting) {
    sorting.Add(new SortProperty(sortProperty.PropertyName, sortProperty.Direction));
}
collectionSource.Sorting = sorting;

In this instance, all SortProperty items will be applied simultaneously.

See Also