Skip to main content
.NET 6.0+

CollectionSourceBase.Sorting Property

Specifies the CollectionSourceBase.Collection‘s sort settings.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public IList<SortProperty> Sorting { get; set; }

Property Value

Type Description
IList<SortProperty>

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

Remarks

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