maui-devexpress-dot-maui-dot-collectionview-dot-dxcollectionview-167f83dd.md
Specifies how to sort data items in the view.
Namespace : DevExpress.Maui.CollectionView
Assembly : DevExpress.Maui.CollectionView.dll
NuGet Package : DevExpress.Maui.CollectionView
public ObservableCollection<SortDescription> SortDescriptions { get; }
| Type |
|---|
| ObservableCollection<SortDescription> |
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.
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>
See Also