Devexpress Pivotgrid: How to define custom summary

て烟熏妆下的殇ゞ 提交于 2019-12-08 13:37:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!