我有一个由ASPxpivotgrid制作的数据透视网格。任何创建pivotgrid的人都知道,pivotgrid中有一个可选的行摘要行。它有一些选项,如Sum,Avg,Min,Max,Var等,但我需要在摘要行中有Min / Max。我知道有另一个选项,如“自定义”,但虽然我检查了很多例子和页面,但我找不到任何描述如何定义自定义摘要的明确示例。
我的问题是,如何定义自定义摘要?
答案 0 :(得分:0)
这应该是类似的,但它来自winform方面。
有一个事件' CustomCellDisplayText'每次绘制一个单元格时都会调用它。在此范围内,您可以检查单元格是否为摘要单元格。
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