Calculate GroupSummary Value programmatically in DevExpress

谁都会走 提交于 2019-12-10 22:24:08

问题


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" />

When i grouping, I want calculate another column's GroupSummary value like;

 GroupSummary[RISK_EUR] - GroupSummary[IPOTEK] - GroupSummary[MV_BERND]

How?

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)


回答1:


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.



来源:https://stackoverflow.com/questions/5942330/calculate-groupsummary-value-programmatically-in-devexpress

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