Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SortDescription Class

Specifies how to sort CollectionView items.

Namespace: DevExpress.Maui.CollectionView

Assembly: DevExpress.Maui.CollectionView.dll

NuGet Package: DevExpress.Maui.CollectionView

#Declaration

C#
public class SortDescription :
    SortDescriptionBase

#Remarks

You can apply multiple sorting rules to collection view items. The rules are applied in the same order they have in the SortDescriptions collection.

To configure a sorting rule, create a SortDescription object and specify its options:

FieldName
Defines the name of the data source field whose values are used to sort items.
SortOrder
Specifies whether items should be in ascending or descending order.

Then, add the SortDescription object to the SortDescriptions collection.

To group collection view items, specify the DXCollectionView.GroupDescription property.

For more information on how to shape collection view data, refer to the following help topic: Filter, Sort, and Group Data in Collection View for .NET MAUI.

#Example

The following example sorts collection view items in descending order:

<dxcv:DXCollectionView ...>
    <dxcv:DXCollectionView.SortDescriptions>
        <dxcv:SortDescription FieldName="Name" SortOrder="Descending"/>
    </dxcv:DXCollectionView.SortDescriptions>
</dxcv:DXCollectionView>

#Inheritance

System.Object
BindableObject
Element
DevExpress.Maui.Core.Internal.DXElementBaseCore
See Also