Dimension.SortOrder Property
Gets or sets the sort order of dimension values.
Namespace: DevExpress.DashboardCommon
Assembly: DevExpress.Dashboard.v24.2.Core.dll
NuGet Package: DevExpress.Dashboard.Core
#Declaration
[DefaultValue(DimensionSortOrder.Ascending)]
public DimensionSortOrder SortOrder { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
Dimension |
Ascending | A Dimension |
Available values:
Name | Description |
---|---|
Ascending | Sort dimension values in ascending order. |
Descending | Sort dimension values in descending order. |
None | No sorting is applied to dimension values. Note Note that this sort order is in effect in OLAP mode only. |
#Remarks
Use the SortOrder property to toggle the sort order of dimension values.
To sort dimension values by a measure, use the Dimension.SortByMeasure property.
When the Top N Values feature is enabled, dimension values are forcibly sorted by the DimensionTopNOptions.Measure and the order is descending for Top N and ascending for Bottom N.
#Example
The following code snippet shows how to sort values of the Continent dimension by summary values calculated for the Amount measure.
Dimension continentDimension = new Dimension("Continent");
Measure amountMeasure = new Measure("Amount", SummaryType.Sum);
continentDimension.SortByMeasure = amountMeasure;
continentDimension.SortOrder = DimensionSortOrder.Descending;