Back to Devexpress

PivotWindowDefinitionMode Enum

dashboard-devexpress-dot-dashboardcommon-a2794a6a.md

latest4.3 KB
Original Source

PivotWindowDefinitionMode Enum

A window definition mode used to specify a window within the PivotDashboardItem.

Namespace : DevExpress.DashboardCommon

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

NuGet Package : DevExpress.Dashboard.Core

Declaration

csharp
public enum PivotWindowDefinitionMode
vb
Public Enum PivotWindowDefinitionMode

Members

NameDescription
Columns

A calculation is performed horizontally through Pivot columns.

| | Rows |

A calculation is performed vertically through Pivot rows.

| | ColumnsAndRows |

A calculation is performed horizontally through Pivot columns, then rows.

| | RowsAndColumns |

A calculation is performed vertically through Pivot rows, then columns.

| | GroupsInColumns |

A calculation is performed horizontally through Pivot columns within groups.

| | GroupsInRows |

A calculation is performed vertically through Pivot rows within groups.

| | GroupsInColumnsAndRows |

A calculation is performed horizontally through Pivot columns, then rows within groups.

| | GroupsInRowsAndColumns |

A calculation is performed vertically through Pivot rows, then columns within groups.

|

The following properties accept/return PivotWindowDefinitionMode values:

Remarks

Values listed in this enumeration are used to set the PivotWindowDefinition.DefinitionMode property.

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.

csharp
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);
}
vb
Imports DevExpress.DashboardCommon
Imports DevExpress.DashboardWin
' ...
Dim pivotItem As PivotDashboardItem = TryCast(dashboardViewer1.Dashboard.Items(pivotItemName), PivotDashboardItem)
If pivotItem IsNot Nothing Then
    Dim extendedPrice As New Measure("Extended Price") With { _
        .Name = "Diff", _
        .ShowGrandTotals = False _
    }
    Dim pivotWindowDefinition As New PivotWindowDefinition()
    pivotWindowDefinition.DefinitionMode = PivotWindowDefinitionMode.Columns
    extendedPrice.WindowDefinition = pivotWindowDefinition
    extendedPrice.Calculation = New DifferenceCalculation() With {.DifferenceType = DifferenceType.Absolute}
    pivotItem.Values.Add(extendedPrice)
End If

See Also

DevExpress.DashboardCommon Namespace