I am struggling to create subtotals for grouped break lines. I am looking at Samples Explorer and *almost* seeing what I want, but I don't see the code. I will be having some columns summed, and some columns would be a percentage calculation based on two other column values. Here I see a sum, and an average, but I have no idea how these are accomplished. In addition, it may not be possible, but I'd rather have the totals inside the salmon-colored 'SubTotals' line, rather than on a line below it, which just wastes space. But I haven't found the right magic combination - subtotals for the group, at the bottom, not the top, on the same line as the 'SubTotals' heading. But most of all, this question pertains to *how* one gets the columns to sum, average, and how I'd do a percentage. I presume that this sample is NOT iterating through all the rows and adding them up in code. I presume the grid can do that for me without my having to build a loop. If so, how? Thanks.
Looks like the image was too big. Let's try again. I added the salmon coloring manually to indicate where I'd like the subtotals to go.
I am starting to get somewhere, but I am still fairly lost. Notes in the picture explain what I am still struggling with.
Hello,
I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.
Thank you for using Infragistics Components.
Thank you for contacting Infragistics Developer Support.
It seems that this topic is fairly similar to this one: http://es.infragistics.com/community/forums/t/89469.aspx
Have you had the time to take a look at my answer? Let me know if something in the explanation isn’t clear to you. In order to calculate summaries based on the values of other columns you should use the UltraCalcManager. With it you can create a custom summary based on the values of the two columns. Its formula in your case will look something like:
“sum([total_enrollments_week])/sum([potential_transactions_week])/100”
For the summary caption you should set the SummaryFooterCaption of the UltraGridBand to “Totals for District [GROUPBYROWVALUE]”. For more information visit this link:
http://help.infragistics.com/Help/Doc/WinForms/2011.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.2~Infragistics.Win.UltraWinGrid.UltraGridBand~SummaryFooterCaption.html
There are three different appearance objects with which you can control the appearance of the summary area. These are SummaryFooterAppearance, SummaryFooterCaptionAppearance and SummaryValueAppearance. You can find them in the Override object of the grid.
As for why there aren’t any summary rows for “Region” that is because “Region” has no DataRows collection (only GroupByRows). If you have set the SummaryDisplay area to Bottom or BottomFixed, the summaries will only be displayed at the end of the DataRows collection. If you leave it at its “Default” value the summaries will be displayed in the GroupByRows and at the end of the DataRows collections.
I have attached a modified version of my sample from the previous thread in VS2010 and VS2012.
Please let me know if I am missing something or if something in my explanation isn’t clear to you.