CollectionSourceBase.Sorting Property
In This Article
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<Sort |
A list of Sort |
#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