Back to Devexpress

SortDescription Class

maui-devexpress-dot-maui-dot-collectionview-9daee3fc.md

latest2.9 KB
Original Source

SortDescription Class

Specifies how to sort CollectionView items.

Namespace : DevExpress.Maui.CollectionView

Assembly : DevExpress.Maui.CollectionView.dll

NuGet Package : DevExpress.Maui.CollectionView

Declaration

csharp
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:

FieldNameDefines the name of the data source field whose values are used to sort items.SortOrderSpecifies 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:

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

Implements

INotifyPropertyChanged

IElementController

Inheritance

System.Object BindableObject Element DevExpress.Maui.Core.Internal.DXElementBaseCore SortDescriptionBase SortDescription TreeViewSortDescription

Extension Methods

Yield<SortDescription>()

YieldIfNotNull<SortDescription>()

See Also

SortDescription Members

DevExpress.Maui.CollectionView Namespace