Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Bind Pivot Grid Fields to Data Columns

This topic describes how to use the Binding API to bind a Pivot Grid field to a data source column in Server mode.

Important

You cannot bind the Pivot Grid to data at design time in .NET 5+ projects.

Follow the steps below to bind a Pivot Grid field to a data source column in code:

  1. Create a DataSourceColumnBinding instance.
  2. Set the DataSourceColumnBinding.ColumnName property to the name of a data source column.
  3. Assign the DataSourceColumnBinding object to the PivotGridField.DataBinding property.

The following code snippet illustrates the Pivot Grid’s Product Sales field bound to the Extended Price source column:

<dxpg:PivotGridControl>
    <dxpg:PivotGridControl.Fields>
      <dxpg:PivotGridField
          Area="DataArea"
          AreaIndex="5"
          Caption="Product Sales"
          CellFormat="C"
          Name="fieldSales">
          <dxpg:PivotGridField.DataBinding>
              <dxpg:DataSourceColumnBinding ColumnName="Extended Price" />
          </dxpg:PivotGridField.DataBinding>
        </dxpg:PivotGridField>
      </dxpg:PivotGridControl.Fields>
</dxpg:PivotGridControl>