Skip to main content

PivotGridField.Area Property

Gets or sets the area in which the field is displayed. This is a dependency property.

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Package: DevExpress.Wpf.PivotGrid


public FieldArea Area { get; set; }

Property Value

Type Description

A FieldArea value that specifies the area in which the field is displayed.

Available values:

Name Description

Corresponds to the row header area.


Corresponds to the column header area.


Corresponds to the filter header area.


Corresponds to the data header area.


A field can be placed in one of four areas: Filter Header Area, Column Header Area, Row Header Area or Data Header Area. The Area property specifies the area in which the field is displayed. The field can also be positioned using the PivotGridField.SetAreaPosition method. To get the field’s position among the other fields within the same area, use the PivotGridField.AreaIndex property.

The PivotGridField.AllowedAreas property specifies in which areas the field can be located. To obtain whether the field can be displayed in a particular area, use the PivotGridField.IsAreaAllowed property.

Dragging a field from one area to another automatically changes the Area property value, and vice versa. Before the field location is changed, PivotGridControl fires the PivotGridControl.FieldAreaChanging event, allowing you to cancel the action. After the location has been changed, the PivotGridControl.FieldAreaChanged event is fired.

Multiple fields can be combined into a group via the PivotGridControl.Groups property. These fields cannot be separated and are always dragged together. To move a group to a specific area or to a new position within the current area, use the Area and PivotGridField.AreaIndex properties of the first field in the group. Modifying the Area and AreaIndex properties for the second and subsequent fields in the group is ignored.


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 example.

<Window x:Class="HowToBindToMDB.MainWindow"
        Title="MainWindow" Height="350" Width="525"  Loaded="Window_Loaded">
        <dxpg:PivotGridControl Name="pivotGridControl1" DataProcessingEngine="Optimized">
                <dxpg:PivotGridField Name="fieldCountry"  Area="RowArea">
                        <dxpg:DataSourceColumnBinding ColumnName="Country"/>
                <dxpg:PivotGridField Name="fieldCustomer" Area="RowArea"
                        <dxpg:DataSourceColumnBinding ColumnName="Sales Person"/>
                <dxpg:PivotGridField Name="fieldYear" Area="ColumnArea" Caption="Year" >
                        <dxpg:DataSourceColumnBinding ColumnName="OrderDate" GroupInterval="DateYear"/>
                <dxpg:PivotGridField Name="fieldCategoryName" Area="ColumnArea" Caption="Product Category">
                        <dxpg:DataSourceColumnBinding ColumnName="CategoryName"/>
                <dxpg:PivotGridField Name="fieldProductName" Area="FilterArea" Caption="Product Name">
                        <dxpg:DataSourceColumnBinding ColumnName="ProductName"/>
                <dxpg:PivotGridField Name="fieldExtendedPrice" Area="DataArea" CellFormat="c0">
                        <dxpg:DataSourceColumnBinding ColumnName="Extended Price"/>

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


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.

See Also