Tag

PivotGridField.TopValueShowOthers Property

Gets or sets whether the "Others" item is displayed within the PivotGridControl when the Top N Values feature is enabled. This is a dependency property.

Namespace: DevExpress.Xpf.PivotGrid

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

Declaration

public bool TopValueShowOthers { get; set; }
Public Property TopValueShowOthers As Boolean

Property Value

Type Description
Boolean

true if the "Others" item is displayed when the Top N Values feature is enabled; otherwise, false.

Remarks

The PivotGridField.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 N Values 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 PivotGridField.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 default "Others" substring can be localized. See the Localizing WPF Controls via Localizer Objects document for more information. Another way to customize the "Others" header is to handle the PivotGridControl.FieldValueDisplayText event.

Examples

This example demonstrates how to avoid browsing an entire report, but only show the best or worst results. For this purpose, the PivotGridControl provides the Top N Values feature, which can be used to limit the number of displayed field values to the specified number of topmost values according to the sort order.

To enable this feature, the PivotGridField.TopValueCount property must be used. This property allows you to restrict the number of field values that are displayed along the column or row axis.

NOTE

A complete sample project is available at https://github.com/DevExpress-Examples/how-to-display-top-n-values-e2142.

<Window x:Class="HowToBindToMDB.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:dxpg="http://schemas.devexpress.com/winfx/2008/xaml/pivotgrid"
        Title="MainWindow" Height="350" Width="525"  Loaded="Window_Loaded">
    <Grid Margin="7">
        <dxpg:PivotGridControl HorizontalAlignment="Left" Name="pivotGridControl1"
                               VerticalAlignment="Top">
            <dxpg:PivotGridControl.Fields>
                <dxpg:PivotGridField x:Name="fieldCountry" FieldName="Country" Area="RowArea"/>
                <dxpg:PivotGridField x:Name="fieldCustomer" FieldName="Sales Person" Area="RowArea"
                                     SortByField="{Binding ElementName=fieldExtendedPrice}"
                                     Caption="Customer" TopValueCount="3"
                                     TopValueShowOthers="True"
                                     SortOrder="Descending"/>
                <dxpg:PivotGridField x:Name="fieldExtendedPrice" FieldName="Extended Price"
                                     Area="DataArea" CellFormat="c0" />
            </dxpg:PivotGridControl.Fields>
        </dxpg:PivotGridControl>
    </Grid>
</Window>
See Also