Devexpress Pivotgrid: How to define custom summary

devexpresspivot tablesummary

I have a pivot grid made by ASPxpivotgrid. As anyone whoever made a pivotgrid would know, there is an optional row summary line in pivotgrid. It has some options like Sum, Avg, Min, Max, Var etc. but I need to have Min / Max in the summary line. I know there is another option like "Custom" but although I checked so many examples and pages, I couldn't find any clear example that describes how to define a Custom summary.

My question is, how to define a custom summary?

Best Answer

This should be similar, but it comes from the winform side.

There is an event 'CustomCellDisplayText' that gets called each time a cell is drawn. Within this you can check to see if the cell is a summary cell.

Private Sub PivotGridControl1_CustomCellDisplayText(sender As System.Object, e As DevExpress.XtraPivotGrid.PivotCellDisplayTextEventArgs) Handles PivotGridControl1.CustomCellDisplayText
    ' format column totals
    If e.RowValueType = DevExpress.XtraPivotGrid.PivotGridValueType.GrandTotal Then
      ' do something
    End If

    ' format row totals
    If e.ColumnValueType = DevExpress.XtraPivotGrid.PivotGridValueType.GrandTotal Then
      ' do something
    End If
End Sub
Related Topic