wpf-devexpress-dot-xpf-dot-pivotgrid-dot-pivotgridfield-0245b51b.md
Gets or sets an object that specifies the Pivot Grid field’s source data.
Namespace : DevExpress.Xpf.PivotGrid
Assembly : DevExpress.Xpf.PivotGrid.v25.2.dll
NuGet Package : DevExpress.Wpf.PivotGrid
public DataBinding DataBinding { get; set; }
Public Property DataBinding As DataBinding
| Type | Description |
|---|---|
| DataBinding |
A DataBinding object that specifies the source data for the Pivot Grid fields.
|
Pivot Grid uses the Binding API to bind Pivot Grid fields to data. Data binding sources can be columns in a data source, calculated expressions, or window calculations.
Refer to the following topics for information on how to bind Pivot Grid fields to data:
Each specified binding object is a DataBinding descendant. This object is assigned to the Pivot Grid field’s 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>
The following code snippets (auto-collected from DevExpress Examples) contain references to the DataBinding property.
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.
Caption="Product Sales">
<dxpg:PivotGridField.DataBinding>
<dxpg:DataSourceColumnBinding ColumnName="ExtendedPrice"/>
wpf-pivotgrid-hide-column-totals/CS/HowToBindToMDB/MainWindow.xaml#L14
<dxpg:PivotGridField Name="fieldOrderID" Area="RowArea">
<dxpg:PivotGridField.DataBinding>
<dxpg:DataSourceColumnBinding ColumnName="OrderID"/>
wpf-pivotgrid-how-to-display-underlying-data/CS/WpfDrillDownDataSourceExample/MainWindow.xaml#L37
Caption="Product Sales">
<dxpg:PivotGridField.DataBinding>
<dxpg:DataSourceColumnBinding ColumnName="ExtendedPrice"/>
Name="fieldCountry" AreaIndex="0">
<dxpg:PivotGridField.DataBinding>
<dxpg:DataSourceColumnBinding ColumnName="Country"/>
wpf-pivot-grid-obtain-underlying-data/CS/ObtainUnderlyingData/MainWindow.xaml#L64
Name="fieldCountry" >
<dxpg:PivotGridField.DataBinding>
<dxpg:DataSourceColumnBinding ColumnName="Country"/>
wpf-pivot-grid-bind-to-an-olap-cube-net6/CS/HowToBindOLAP/MainWindow.xaml.cs#L33
// Populate fields with data.
fieldMeasuresInternetSalesAmount.DataBinding =
new DataSourceColumnBinding("[Measures].[Internet Sales Amount]");
wpf-pivot-grid-bind-to-an-mdb-database/CS/HowToBindToMDB/MainWindow.xaml.cs#L38
DataBinding orderDateBinding = pivotGridControl1.Fields["OrderDate"].DataBinding;
(orderDateBinding as DataSourceColumnBinding).GroupInterval = FieldGroupInterval.DateYear;
wpf-pivotgrid-hide-column-totals/CS/HowToBindToMDB/MainWindow.xaml.cs#L38
field.Area = area;
field.DataBinding = new DataSourceColumnBinding(columnName);
field.AreaIndex = index;
wpf-pivot-grid-change-summary-display-type/VB/HeaderMenuCustomizationExample/HeaderMenuHelper.vb#L98
Case FieldSummaryDisplayType.AbsoluteVariation
field.DataBinding = New DifferenceBinding(sourceBinding, CalculationPartitioningCriteria.RowValue, CalculationDirection.DownThenAcross, DifferenceTarget.Previous, DifferenceType.Absolute)
Case FieldSummaryDisplayType.PercentVariation
wpf-pivot-grid-bind-to-an-olap-cube-net6/VB/HowToBindOLAP/MainWindow.xaml.vb#L31
' Populate fields with data.
fieldMeasuresInternetSalesAmount.DataBinding = New DataSourceColumnBinding("[Measures].[Internet Sales Amount]")
wpf-pivot-grid-bind-to-an-mdb-database/VB/HowToBindToMDB/MainWindow.xaml.vb#L34
AddField("Price", FieldArea.DataArea, "Extended Price", 0)
Dim orderDateBinding As DataBinding = pivotGridControl1.Fields("OrderDate").DataBinding
TryCast(orderDateBinding, DataSourceColumnBinding).GroupInterval = FieldGroupInterval.DateYear
See Also