Skip to main content
A newer version of this page is available. .

PivotGridControl Class

The PivotGrid control.

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Package: DevExpress.Wpf.PivotGrid

Declaration

[OLAPDataAccessMetadata("All", SupportedProcessingModes = "Pivot", OLAPConnectionStringProperty = "OlapConnectionString", OLAPDataProviderProperty = "OlapDataProvider", DataSourceProperty = "DataSource")]
public class PivotGridControl :
    Control,
    IPrintableControl,
    IFormatsOwner,
    INotifyPropertyChanged,
    IPivotGridEventsImplementor,
    IPivotGridEventsImplementorBase,
    IPivotGridDataContainerCore,
    ILogicalOwner,
    IInputElement,
    IWeakEventListener,
    ISupportInitialize,
    IFormatConditionCollectionOwner,
    IThreadSafeAccessible

Remarks

The PivotGridControl represents data from a data source in cross-tab form. It calculates summaries and summary totals against specific fields and displays the summary values within data cells. The following summary functions are supported: Sum, Average, Count, Min, Max, StdDev, StdDevp, StdVar, StdVarp.

GettingStarted_L1_ApplicationLaunch

Fields are basic blocks, representing data source fields, which an end-user can manipulate in the PivotGridControl. Fields are visually represented by field headers, which can be moved between the pivot grid’s areas using drag-and-drop. Dragging fields between areas allows you to reorganize the data and present it in various forms. The collection of fields can be accessed via the PivotGridControl.Fields property. Individual fields are represented by the PivotGridField class and can be accessed using indexed notation.

For detailed information on key features introduced by the DXPivotGrid, see:

Example

The following example demonstrates how to programmatically bind the PivotGridControl to a “SalesPerson” view in the nwind.mdb database, which is shipped with the installation. The control will be used to analyse sales per country, customers, product categories and years.

First, data is obtained from an MDB database via the OleDbConnection, OleDbDataAdapter and DataSet components. Secondly, the PivotGridControl is bound to a table in the dataset via the PivotGridControl.DataSource property. Lastly, pivot grid fields are created that will represent datasource fields. They are positioned within appropriate areas to analyze the data in the way you want.

Note that if you want to see an example of how to add pivot grid fields in XAML, please refer to the How to: Bind a PivotGrid to an MS Access Database tutorial.

View Example

<Window x:Class="HowToBindToMDB.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxpg="http://schemas.devexpress.com/winfx/2008/xaml/pivotgrid"
        Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
    <Grid>
        <dxpg:PivotGridControl Name="pivotGridControl1" 
                               HorizontalAlignment="Left" VerticalAlignment="Top" />
    </Grid>
</Window>

The following code snippets (auto-collected from DevExpress Examples) contain references to the PivotGridControl class.

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.

Implements

See Also