Back to Devexpress

MovingCalculationBinding Class

wpf-devexpress-dot-xpf-dot-pivotgrid-0e76f856.md

latest4.2 KB
Original Source

MovingCalculationBinding Class

Defines aggregations across a specified number of values before and/or after the current value.

Namespace : DevExpress.Xpf.PivotGrid

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

NuGet Package : DevExpress.Wpf.PivotGrid

Declaration

csharp
public class MovingCalculationBinding :
    DirectedCalculationBinding
vb
Public Class MovingCalculationBinding
    Inherits DirectedCalculationBinding

Remarks

To bind a Pivot Grid field to the result of the calculation in Optimized mode, do the following:

  1. Create an instance of the MovingCalculationBinding class with the Source property set to the DataBinding descendant instance.
  2. Specify the window frame and calculation settings.
  3. Assign the MovingCalculationBinding instance to the PivotGridField.DataBinding property.

The example below shows how to use MovingCalculationBinding to display totals of the Extended Price field’s neighboring values.

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

xaml
<dxpg:PivotGridControl
<!-- ... -->
    DataProcessingEngine="Optimized"
    <!-- ... -->
    <dxpg:PivotGridControl.Fields>
    <!-- ... -->
        </dxpg:PivotGridField>
        <dxpg:PivotGridField
            Area="DataArea"
            AreaIndex="3"
            Caption="Moving Average"
            CellFormat="C"
            Name="fieldMovingAverage">
            <dxpg:PivotGridField.DataBinding>
                <dxpg:MovingCalculationBinding
                    NextValuesCount="1"
                    PartitioningCriteria="ColumnValue"
                    PreviousValuesCount="1"
                    SummaryType="Sum">
                    <dxpg:MovingCalculationBinding.Source>
                        <dxpg:DataSourceColumnBinding ColumnName="Extended Price" />
                    </dxpg:MovingCalculationBinding.Source>
                </dxpg:MovingCalculationBinding>
            </dxpg:PivotGridField.DataBinding>
        </dxpg:PivotGridField>
        <!-- ... -->
    </dxpg:PivotGridControl.Fields>
</dxpg:PivotGridControl>

Inheritance

Object DispatcherObject DependencyObject ContentElement FrameworkContentElement DXFrameworkContentElement DataBinding CalculationBinding DirectedCalculationBinding MovingCalculationBinding

See Also

MovingCalculationBinding Members

Optimized Calculation Engine

Window Calculations Overview

Bind Pivot Grid Fields to Window Calculations

DevExpress.Xpf.PivotGrid Namespace