[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Collapse]Fundamentals
    [Expand]Information Presentation
     Fields
     Product Class Structure
     Attached Properties
     Commands
   [Expand]Binding to Data
   [Expand]Data Shaping
   [Expand]Data Analysis
   [Expand]Layout
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Appearance
   [Expand]MVVM Enhancements
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Fields

To create a compact report, the Pivot Grid control requires you to create a number of fields (objects bound to real data source fields) and position these fields within appropriate areas.

The field's function is determined by the area in which it is displayed:

  • Position a field within the Column Header Area to list its values along the grid's top edge. The field's values will represent column headers.
  • Position a field within the Row Header Area to list its values along the grid's left edge. The field's values will represent row headers.
  • Position a field within the Data Header Area to calculate summaries against this field.
  • Position a field within the Filter Header Area to make this field available for data filtering or further customizations (e.g. it can be dragged to a different area later on).

Expanded Binding Basics

The DXPivotGrid control supports bound and unbound fields. A bound field retrieves data from a field in a pivot grid's data source. An unbound field is not associated with a data source and should be populated with data manually. To learn more on unbound fields, see Unbound Fields.

To bind a pivot grid field to a data source field, use the PivotGridField.FieldName property. This property provides the name of the data field bound to the pivot grid field. The PivotGridField.UnboundType property must be set to FieldUnboundColumnType.Bound.

To learn more, see Binding to Data Overview and Binding to OLAP Data Sources.

Expanded Example: How to Bind a PivotGrid Control to an MS Access Database

The following example demonstrates how to 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.

The following steps were used to created this example:

  1. A typed dataset is created from the database at design time.
  2. Instances of SalesPersonDataTable and SalesPersonTableAdapter objects are created.
  3. The PivotGridControl is bound to the SalesPersonDataTable instance via the PivotGridControl.DataSource property.
  4. The table is filled with data in the Window_Loaded event handler.

The pivot grid fields that will represent data source fields are created in XAML markup. 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 programmatically add pivot grid fields, please refer to the How to: Bind a PivotGrid to an MS Access Database Programmatically tutorial.

Is this topic helpful?​​​​​​​