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

XPBaseCollection.Sorting Property

Gets or sets the sort settings for the current collection.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v20.2.dll

Declaration

public SortingCollection Sorting { get; set; }
Public Property Sorting As SortingCollection

Property Value

Type Description
SortingCollection

The SortingCollection that specifies the sort order for the collection.

Remarks

Calling the SortingCollection's Add, Remove and Clear methods is not allowed. To sort a collection, a new SortingCollection object must be created and assigned to the Sorting property.

using DevExpress.Xpo;
using DevExpress.Xpo.DB;
// ...
xpCollectionPerson.Sorting = new SortingCollection(
    new SortProperty("Name", SortingDirection.Ascending)
);

To learn more, see Sorting.

NOTE

For performance reasons, we recommend that you not use the JoinOperand in sort properties, as this significantly increases the number of queries sent to the server.

See Also