【问题标题】:Devexpress Pivotgrid: How to define custom summaryDevexpress Pivotgrid:如何定义自定义摘要
【发布时间】:2014-03-26 15:04:35
【问题描述】:
我有一个由 ASPxpivotgrid 制作的枢轴网格。任何制作数据透视网格的人都知道,数据透视网格中有一个可选的行摘要行。它有一些选项,如 Sum、Avg、Min、Max、Var 等,但我需要在摘要行中有 Min / Max。我知道还有另一个选项,例如“自定义”,但是尽管我检查了很多示例和页面,但我找不到任何描述如何定义自定义摘要的清晰示例。
我的问题是,如何定义自定义摘要?
【问题讨论】:
标签:
devexpress
pivot-table
summary
【解决方案1】:
这应该是类似的,但它来自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