PivotGridField.SortByField Property

Gets or sets the field whose summary values define the order in which the field's values are arranged. This is a dependency property.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v20.1.dll


public PivotGridField SortByField { get; set; }
Public Property SortByField As PivotGridField

Property Value

Type Description

A PivotGridField object that represents the field whose summary values define the order in which the field's values are arranged. Note that this field should be placed in Data Header Area.


To sort data by summaries, do the following:

To learn more, see Sorting by Summary.


This example shows how to sort data by Grand Total values.

In this example, values of the Sales Person field are sorted by the Grand Total column. To do this, the data field by whose values the sorting should be performed (the Order Amount field) is assigned to the Sales Person field's PivotGridField.SortByField property.

<Window x:Class="HowToBindToMDB.MainWindow"
        Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
        <dxpg:PivotGridControl HorizontalAlignment="Left" Name="pivotGridControl1" 
                <dxpg:PivotGridField Name="fieldMonth" FieldName="OrderDate" Area="RowArea"
                                     Caption="Order Month" GroupInterval="DateMonth" />
                <dxpg:PivotGridField Name="fieldSalesPerson" FieldName="Sales Person" Area="RowArea"
                                     SortByField="{Binding ElementName=fieldOrderAmount}"
                                     Caption="Sales Person" SortOrder="Descending"/>                
                <dxpg:PivotGridField Name="fieldOrderAmount" FieldName="Extended Price" Area="DataArea"
                                     Caption="Order Amount" CellFormat="c0" />
See Also