Skip to main content
Tag

PivotGridField.TopValueCount Property

Gets or sets an absolute or relative number of field values to be displayed for the current column or row field. This is a dependency property.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v14.2.dll

#Declaration

[XtraSerializablePropertyId(2)]
[XtraSerializableProperty]
public int TopValueCount { get; set; }

#Property Value

Type Description
Int32

An integer value that specifies the number of field values to be displayed for the current column or row field.

#Remarks

If this property is set to 0, PivotGridControl displays all the values of the current row field (or column field) along the control's left (or top) edge.

PivotGridControl allows you to display top field values according to the current sort order, while ignoring the values that follow these first values.

If the PivotGridField.TopValueType property is set to FieldTopValueType.Absolute, the TopValueCount property determines the absolute number of top field values to display. For instance, if there are 20 unique field values and the TopValueCount property is set to 10, only the 10 top field values will be displayed.

If the PivotGridField.TopValueType property is set to FieldTopValueType.Percent, the effect depends on the current data binding mode as follows:

  • In a regular data binding mode, the TopValueCount property determines the number of field values to display relative to the total number of field values. For instance, if there are 20 unique field values and the TopValueCount property is set to 10, only 2 top field values (10% out of 20) will be displayed.
  • In an OLAP mode, PivotGridControl will display top values whose cumulative total is equal to or greater than a specified percentage. For instance, if the TopValueCount property is set to 10, PivotGridControl will display values whose cumulative total is not less than 10% of the Grand Total value.

The TopValueCount property, along with the Sorting by Summary feature, allows you to implement a Top N Values report, which will show only the first records while ignoring the rest. The Top Values demo illustrates this functionality.

NOTE

In OLAP mode, totals are calculated against all values even if the Top N values feature is enabled.

See Also