Skip to main content

CalculationBinding.Source Property

Gets or sets a data binding object that provides the data to calculate.

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Package: DevExpress.Wpf.PivotGrid

Declaration

public DataBinding Source { get; set; }

Property Value

Type Description
DataBinding

A DataBinding descendant that provides the source data.

Remarks

A Source can be a DataSourceColumnBinding object that retrieves data from a data source or any other DataBinding descendant that provides calculated data.

Example

The example below shows how to use RunningTotalBinding to display a cumulative total of the Extended Price field values.

View Example: Pivot Grid Optimized Mode - Field Calculation Data Binding

  1. Create an instance of the RunningTotalBinding class with the Source property set to a DataBinding descendant instance.
  2. Specify the window frame and summary type.
  3. Assign the RunningTotalBinding instance to the PivotGridField.DataBinding property.
<dxpg:PivotGridControl
<!-- ... -->
    DataProcessingEngine="Optimized"
    <!-- ... -->
    <dxpg:PivotGridControl.Fields>
    <!-- ... -->
        <dxpg:PivotGridField
            Area="DataArea"
            AreaIndex="4"
            Caption="Running Total"
            CellFormat="C"
            Name="fieldRunningTotal">
            <dxpg:PivotGridField.DataBinding>
                <dxpg:RunningTotalBinding PartitioningCriteria="ColumnValue" SummaryType="Sum">
                    <dxpg:RunningTotalBinding.Source>
                        <dxpg:DataSourceColumnBinding ColumnName="Extended Price" />
                    </dxpg:RunningTotalBinding.Source>
                </dxpg:RunningTotalBinding>
            </dxpg:PivotGridField.DataBinding>
        </dxpg:PivotGridField>
        <!-- ... -->
    </dxpg:PivotGridControl.Fields>
</dxpg:PivotGridControl>
See Also