Skip to main content

MeasureDefinition.WindowDefinition Property

Gets a window definition used to apply a calculation.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v24.2.Core.dll

Declaration

public MeasureCalculationWindowDefinition WindowDefinition { get; }

Property Value

Type Description
MeasureCalculationWindowDefinition

A MeasureCalculationWindowDefinition descendant that is a window definition used to apply a calculation.

Remarks

Important

The assignment of a MeasureCalculationWindowDefinition descendant instance to the WindowDefinition property is required to perform window calculations.

Example

The code snippet adds a new measure to the Pivot dashboard item and specifies a window calculation to compute the difference between measure values across a window. The calculation is performed along columns of the Pivot dashboard item.

using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;
// ...
PivotDashboardItem pivotItem = dashboardViewer1.Dashboard.Items[pivotItemName] as PivotDashboardItem;
if (pivotItem != null)
{
    Measure extendedPrice = new Measure("Extended Price")
    {
        Name = "Diff",
        ShowGrandTotals = false
    };
    PivotWindowDefinition pivotWindowDefinition = new PivotWindowDefinition();
    pivotWindowDefinition.DefinitionMode = PivotWindowDefinitionMode.Columns;
    extendedPrice.WindowDefinition = pivotWindowDefinition;
    extendedPrice.Calculation = new DifferenceCalculation() { DifferenceType = DifferenceType.Absolute };
    pivotItem.Values.Add(extendedPrice);
}
See Also