Skip to main content
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

CollectionSourceBase.Sorting Property

Specifies the CollectionSourceBase.Collection‘s sort settings.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.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