PivotGridFieldBase.SortOrder Property
Gets or sets the field’s sort order.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.PivotGrid.v24.1.Core.dll
NuGet Packages: DevExpress.PivotGrid.Core, DevExpress.Win.Navigation
Declaration
[XtraSerializableProperty(10)]
[XtraSerializablePropertyId(2)]
public PivotSortOrder SortOrder { get; set; }
Property Value
Type | Description |
---|---|
PivotSortOrder | A PivotSortOrder value that specifies the field’s sort order. |
Available values:
Name | Description |
---|---|
Ascending | Sorts the field in ascending order. |
Descending | Sorts the field in descending order. |
Remarks
Data within the PivotGridControl is always sorted against the fields displayed within Column Header Area and Row Header Area (by default, in ascending order). Use the SortOrder property of these fields to change the current sort order. For other fields, changing the SortOrder property value has no effect on data representation until these fields are placed within the Column Header Area or Row Header Area.
You can also use the PivotGridFieldBase.ChangeSortOrder (synchronous) and PivotGridControl.ChangeFieldSortOrderAsync (asynchronous) methods to toggle a field sort order.
To respond to a field’s sort order being changed, handle the PivotGridControl.GridLayout event.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SortOrder property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.