问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/22665053/devexpress-pivotgrid-how-to-define-custom-summary