PivotGridFieldCollection.Add(String, FieldArea) Method

Adds a new field with the specified field name and location to the end of the collection.

Namespace: DevExpress.Xpf.PivotGrid

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


public PivotGridField Add(
    string fieldName,
    FieldArea area
Public Function Add(
    fieldName As String,
    area As FieldArea
) As PivotGridField


Name Type Description
fieldName String

A string that identifies the name of the datasource field that will be assigned to the new PivotGridField object. This value is assigned to the PivotGridField.FieldName property.

area FieldArea

A FieldArea value that identifies the area in which the new field will be positioned. This value is assigned to the PivotGridField.Area property.


Type Description

The PivotGridField object that has been added to the collection.


The following example demonstrates how to bind a PivotGridControl to an MS OLAP cube.

For this, it is required to set the PivotGridControl.OlapConnectionString property value, and add the necessary fields to the PivotGridControl.Fields collection.

<Window xmlns:dxpg="http://schemas.devexpress.com/winfx/2008/xaml/pivotgrid" 
        Title="MainWindow" Loaded="Window_Loaded"
        Height="350" Width="525">
        <dxpg:PivotGridControl HorizontalAlignment="Left" VerticalAlignment="Top" 
                               Name="pivotGridControl1" />
See Also