Back to Devexpress

CalculationBinding.Source Property

wpf-devexpress-dot-xpf-dot-pivotgrid-dot-calculationbinding-75d34364.md

latest3.9 KB
Original Source

CalculationBinding.Source Property

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

Namespace : DevExpress.Xpf.PivotGrid

Assembly : DevExpress.Xpf.PivotGrid.v25.2.dll

NuGet Package : DevExpress.Wpf.PivotGrid

Declaration

csharp
public DataBinding Source { get; set; }
vb
Public Property Source As DataBinding

Property Value

TypeDescription
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.
xaml
<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>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Source 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.

wpf-pivot-grid-define-custom-cell-template-to-performing-data-editing/CS/HowToEditCell/MainWindow.xaml#L88

xml
<dxpg:PercentOfTotalBinding PartitioningCriteria="ColumnValue">
    <dxpg:PercentOfTotalBinding.Source>
        <dxpg:DataSourceColumnBinding ColumnName="ExtendedPrice"/>

See Also

CalculationBinding Class

CalculationBinding Members

DevExpress.Xpf.PivotGrid Namespace