Back to Devexpress

PivotCellEventArgsBase<TField, TData, TCustomTotal>.RowValueType Property

corelibraries-devexpress-dot-xtrapivotgrid-dot-pivotcelleventargsbase-3-586568e0.md

latest3.7 KB
Original Source

PivotCellEventArgsBase<TField, TData, TCustomTotal>.RowValueType Property

Gets the type of row that contains the processed cell.

Namespace : DevExpress.XtraPivotGrid

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

NuGet Packages : DevExpress.PivotGrid.Core, DevExpress.Win.Navigation

Declaration

csharp
public PivotGridValueType RowValueType { get; }
vb
Public ReadOnly Property RowValueType As PivotGridValueType

Property Value

TypeDescription
PivotGridValueType

A PivotGridValueType enumeration value that specifies the type of row in which the processed cell resides.

|

Available values:

NameDescription
Value

Corresponds to a field value.

| | Total |

Corresponds to an automatic total.

| | GrandTotal |

Corresponds to a grand total.

| | CustomTotal |

Corresponds to a custom total.

|

Remarks

Use the RowValueType property to identify whether the processed cell resides within the grand total row, total row, etc.

Example

This example demonstrates how to handle the CustomCellValue event to hide field row totals and grand totals. The total values remain hidden when you expand or collapse field values.

View Example: Pivot Grid for WinForms - Hide Row Totals

cs
private void pivotGridControl1_CustomCellValue(object sender, PivotCellValueEventArgs e) {
    if (e.DataField == fieldLowLevel) {
        PivotGridField lastLevelField = 
            pivotGridControl1.GetFieldsByArea(PivotArea.RowArea).Last();
        if(e.RowValueType == PivotGridValueType.Total 
            || e.RowValueType == PivotGridValueType.GrandTotal 
            || e.RowField != lastLevelField)
            e.Value = null;
    } 
}
vb
Private Sub pivotGridControl1_CustomCellValue(ByVal sender As Object, ByVal e As PivotCellValueEventArgs) Handles pivotGridControl1.CustomCellValue
    If e.DataField Is fieldLowLevel Then
        Dim lastLevelField As PivotGridField = pivotGridControl1.GetFieldsByArea(PivotArea.RowArea).Last()
        If e.RowValueType = PivotGridValueType.Total OrElse e.RowValueType = PivotGridValueType.GrandTotal OrElse e.RowField IsNot lastLevelField Then
            e.Value = Nothing
        End If
    End If
End Sub

See Also

ColumnValueType

PivotCellEventArgsBase<TField, TData, TCustomTotal> Class

PivotCellEventArgsBase<TField, TData, TCustomTotal> Members

DevExpress.XtraPivotGrid Namespace