For a grid with multiple levels of Outlook-style group-by rows, for each level of grouping, is there a way to access the summary values at each level programmatically in the object model, both for reading and writing?
I see that I can access the GroupByRows at different levels by navigating grid.Rows. The GroupByRows have Description and DescriptionWithSummaries properties, which I can access and can change programatically. Their Cells collection is null.
Bands[0] contains the Summaries collection, but this only seems to contain things like summary settings. I'm looking for the actual values at each level.
The only way to set the value of a summary is to use a summary with a CustomSummaryCalculator.
Unfortunately, groupByRow.Rows.SummaryValues[key].Value has a getter but not a setter.
How can we set the values? We're not worried about corrupting the summaries because we would be calculating them all ourselves -- SummaryUpdatesSuspended would always be true.
Right. So to get the summaries for the children of a GroupByRow, you would need to get the GroupByRow and cast it to the correct type, then access it's child rows and use the SummaryValues there:
((UltraGridGroupByRow)grid.Rows[0]).Rows.SummaryValues[mySummaryValueKey].Value
It's possible to have multiple levels of grouping, of roucse. So the Rows collection here might return more GroupByRows, in which case you would have to keep walking down the chain until you get to the real data rows. You can check the IsGroupByRow property on the row to tell if it's a groupby row or a regular data row.
Apparently the Summary values are on the Rows collections.
grid.Rows.SummaryValues[mySummaryValueKey].Value