Soner Gönül
Soner Gönül

Reputation: 98810

Calculate GroupSummary Value programmatically in DevExpress

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)

Upvotes: 2

Views: 5184

Answers (1)

DevExpress Team
DevExpress Team

Reputation: 11376

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.

Upvotes: 2

Related Questions