.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

SortingCollection(SortProperty[]) Constructor

Initializes a new instance of the SortingCollection class and populates it with the specified elements.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v21.1.dll

Declaration

public SortingCollection(
    params SortProperty[] sortProperties
)

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