SortingCollection Class
A collection of SortProperty objects.
Namespace: DevExpress.Xpo
Assembly: DevExpress.Xpo.v24.2.dll
NuGet Package: DevExpress.Xpo
#Declaration
#Related API Members
The following members return SortingCollection objects:
Library | Related API Members |
---|---|
XPO (. |
Objects |
Object |
|
XPBase |
|
XPCursor. |
|
XPData |
|
XPObject |
|
XPView. |
|
XAF: Cross-Platform .NET App UI & Web API | XPObject |
#Remarks
The collection can be assigned to the XPCollection, XPView, XPDataView, or XPCursor object via an object’s Sorting property.
Note
Don’t make your code dependent on the order of records returned by these objects, unless you’ve explicitly sorted them. By default, if the XPCollection, XPView, XPData
#Example
The following example demonstrates how to sort a collection (xpCollectionPerson) in ascending order against a ‘Name’ field.
using DevExpress.Xpo;
using DevExpress.Xpo.DB;
SortingCollection sortCollection = new SortingCollection();
sortCollection.Add(new SortProperty("Name", SortingDirection.Ascending));
xpCollectionPerson.Sorting = sortCollection;