- 3 minutes to read
The DevExpress Dashboard allows you to easily change the sort order of values within a dashboard item. You can also enable sorting by measure values.
Changing Sort Order
The sort order of dimension values is indicated with an arrow.
To change the sort order in the Designer, click the data item. You can also toggle sorting from the data item menu.
To sort dimension values in code, use the Dimension.SortOrder property.
The following code snippet show how create a new dimension and set its sort order to DimensionSortOrder.Descending.
Dimension continentDimension = new Dimension("Continent"); continentDimension.SortOrder = DimensionSortOrder.Descending;
Sorting by Measure Values
Dashboard allows you to sort dimension values by summary values calculated for a specific measure.
To enable sorting by measure in the Designer, use the Sort by submenu in the dimension's menu.
To do this in code, assign the measure to the Dimension.SortByMeasure property.
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;
You can also sort dimension values by the values of hidden measures.
The dashboard control does not allow sorting by measures with applied Window Calculations since the calculation value can depend on the calculated element position.
OLAP Sorting Specifics
In OLAP mode, you can use the following options to specify the sort order for attribute members.
- No Sorting - Specifies the default server sorting for the current attribute.
Sort by - Allows you to choose the OLAP member property by whose values sorting is performed:
- (Value) - sorting is performed by member values;
- (Display Text) - soring is performed by captions associated with members;
- (Key) - sorting is performed by member keys;
- (ID) - sorting is performed by member IDs.
|Dimension.SortOrder||Gets or sets the sort order of dimension values.|
|Dimension.SortByMeasure||Gets or sets a Measure by which values of this data item should be sorted.|
|DimensionSortOrder||Lists values that specify the sort order for dimension values.|