SortingCollection(SortProperty[]) Constructor
Initializes a new instance of the SortingCollection class and populates it with the specified elements.
Namespace: DevExpress.Xpo
Assembly: DevExpress.Xpo.v24.1.dll
NuGet Packages: DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap, DevExpress.Xpo
NuGet Package: DevExpress.Xpo
Declaration
Parameters
Name | Type | Description |
---|---|---|
sortProperties | SortProperty[] | An array of SortProperty objects used to populate the SortingCollection. |
Example
The following example demonstrates how to sort a collection (gridCol) in ascending order against an ‘Item.Name’ field, and then in descending order against a “Quantity” property .
using DevExpress.Xpo;
using DevExpress.Xpo.DB;
SortProperty[] sort = new SortProperty[2];
sort[0] = new SortProperty("Item.Name", SortingDirection.Ascending);
sort[1] = new SortProperty("Quantity", SortingDirection.Descending);
SortingCollection sC = new SortingCollection(sort);
gridCol.Sorting = sC;
See Also