Skip to main content

PivotGridFieldBase.TopValueShowOthers Property

Gets or sets whether the “Others” item is displayed within the Pivot Grid when the Top X Value feature is enabled.

Namespace: DevExpress.XtraPivotGrid

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

NuGet Packages: DevExpress.PivotGrid.Core, DevExpress.Win.Navigation

Declaration

[PivotAPIMemberCategory(APICategory.RelationalSource)]
[TypeConverter(typeof(BooleanTypeConverter))]
[XtraSerializableProperty]
[XtraSerializablePropertyId(2)]
public bool TopValueShowOthers { get; set; }

Property Value

Type Description
Boolean

true if the “Others” item is displayed when the Top X Value feature is enabled; otherwise, false.

Remarks

The PivotGridFieldBase.TopValueCount property can be used to restrict the number of field values displayed along the control’s left or top edge. Setting this property to a positive value enables the Top X Value feature. In this case, the control displays the first field values according to the current sort order, the number of these values is defined by the TopValueCount property. If the TopValueShowOthers property is set to false the values that follow the first values are hidden. If this property is set to true the remaining values will be combined into a single item (“Others”).

The following image shows a sample XtraPivotGrid control which displays all the field values for the ‘Sales Person’ field:

PivotGridField.TopValueShowOthers1

In the next image the same control is displayed. It’s TopValueCount property is set to 5 (the top 5 values are displayed) and the TopValueShowOthers property is set to true:

PivotGridField.TopValueShowOthers2

To replace the default text (“Others”) with a custom string you can create a descendant of the DevExpress.XtraPivotGrid.Localization.PivotGridLocalizer class and override its GetLocalizedString method. An instance of the custom Localizer object should be assigned to the static DevExpress.XtraPivotGrid.Localization.PivotGridLocalizer.Active property.

Another way to customize the “Others” header is to handle the PivotGridControl.FieldValueDisplayText event.

Note

The Others field value is not supported in an OLAP mode.

See Also