问题描述
在我的代码中;我用 ASPxGridview
计算3 GroupSummary
的值;
In my code; I calculate 3 GroupSummary
value with ASPxGridview
;
<dx:ASPxSummaryItem FieldName="RISK_EUR" SummaryType="SUM" ShowInGroupFooterColumn="RISK_EUR" DisplayFormat="n0" />
<dx:ASPxSummaryItem FieldName="IPOTEK" SummaryType="AVERAGE" ShowInGroupFooterColumn="IPOTEK" DisplayFormat="n0" />
<dx:ASPxSummaryItem FieldName="MV_BERND" SummaryType="SUM" ShowInGroupFooterColumn="MV_BERND" DisplayFormat="n0" />
我进行分组时,我想计算另一列的GroupSummary值,例如;
When i grouping, I want calculate another column's GroupSummary value like;
GroupSummary[RISK_EUR] - GroupSummary[IPOTEK] - GroupSummary[MV_BERND]
如何?
注意:我无法计算此值每行,然后将它们总计,因为这3个GroupSummary的SummaryType不相同。 (一个是AVERAGE)
NOTE: I can't calculate this value calculating for every row and then total them, because this 3 GroupSummary's SummaryType isn't same. (One is AVERAGE)
推荐答案
可以使用。调整时,网格将为每个组中的每个记录引发事件。为了区分组,事件参数类提供了SummaryProcess属性。因此,您应该使用此事件处理程序手动计算GroupSummary [RISK_EUR],GroupSummary [IPOTEK]和GroupSummary [MV_BERND]的值。使用它们,您将能够计算结果汇总值。
This can be implemented by using custom summary. When you adjust it, the grid will raise the CustomSummaryCalculate event for every record in every group. To distinguish between groups, the event arguments class provides the SummaryProcess property. So, you should use this event handler to manually calculate GroupSummary[RISK_EUR], GroupSummary[IPOTEK] and GroupSummary[MV_BERND] values. Using them, you will be able to calculate the resulting summary value.
这篇关于在DevExpress中以编程方式计算GroupSummary值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!