dashboard-15694-winforms-dashboard-winforms-designer-create-dashboards-in-the-winforms-designer-data-shaping-sorting.md
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.
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;
Dim continentDimension As New Dimension("Continent")
continentDimension.SortOrder = DimensionSortOrder.Descending
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;
Dim continentDimension As New Dimension("Continent")
Dim amountMeasure As New Measure("Amount", SummaryType.Sum)
continentDimension.SortByMeasure = extendedPriceMeasure
continentDimension.SortOrder = DimensionSortOrder.Descending
You can also sort dimension values by the values of hidden measures.
Note
Sorting by measure cannot be applied if the target measure has a calculation applied.
In OLAP mode, you can use the following options to specify the sort order for attribute members.
To specify the sort mode for attribute members in code, use the Dimension.SortMode property. To sort attribute members, use the Dimension.SortOrder property.
| API | Description |
|---|---|
| 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. |