Skip to main content

PivotGridFieldBase.SortBySummaryInfo Property

Contains the settings used to sort the values of the current column field or row field by summary values in rows/columns.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.PivotGrid.v22.1.Core.dll

Declaration

public PivotGridFieldSortBySummaryInfo SortBySummaryInfo { get; }

Property Value

Type Description
PivotGridFieldSortBySummaryInfo

A PivotGridFieldSortBySummaryInfo object which contains the settings used to sort the current field’s values by summary values in columns/rows.

Remarks

By default, the values of column fields and row fields are arranged in alphabetical order (for text data) and in order of magnitude (for numeric and date/time data).

If the current field is a row field, the SortBySummaryInfo property allows you to arrange this field’s values according to the summary values in any column. Similary, if the current field is a column field, the SortBySummaryInfo property can be used to arrange this field’s values according to the summary values in any row. See How to: Sort Data by Columns (Rows) in Code, for an example.

The SortBySummaryInfo property along with the PivotGridFieldBase.TopValueCount property allows you to implement a Top X Values report, which will show only the first records while ignoring the rest. The Top Values demo illustrates this functionality.

 

Note

In web applications, you must specify the field’s ID property.

Example

This example demonstrates how to sort the values of a ‘Sales Person’ column field by summary values calculated against an ‘Order Amount’ data field. To do this, the PivotGridFieldSortBySummaryInfo.Field property of the ‘Sales Person’ field is set to reference the ‘Order Amount’ field. As a result, the values will be arranged in the order specified by the summary values.

The following images show the PivotGridControl before and after the field values are sorted by the summary values.

Before:

PivotGridField.SortBySummary_None

After:

PivotGridField.SortBySummary_Sum

pivotGridControl1.Fields["Sales Person"].SortBySummaryInfo.Field = 
  pivotGridControl1.Fields["Order Amount"];

The following code snippets (auto-collected from DevExpress Examples) contain references to the SortBySummaryInfo 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.

See Also