I have one Ultragrid that is groupedby using a SortedColumn, using the "ViewStyleBand.OutlookGroupBy" and the "ViewStyle.SingleBand". That gives me, 3 groups of rows, as I want.
I have 3 types of summary added to the SummaryDisplayArea property. "InGroupByRows", "GroupByRowsFooter" and "BottomFixed" for calculating the sum of all the grid.
But the problem is: I want to have independent summaries for each grouprow. With its own behavior. When I collapse a groupbyrow, I want to have the summaries in it(as the property InGroupByRows does), and when I expand the row, I want it to dissapear, so I only have the "GroupByRowsFooter" summary.
Have tried to add/remove the InGroupByRows from the SummaryDisplayArea list in the BeforeRowCollapsed/Expanded events, but, since the summaries work as a whole, when I expand a GroupByRow, for example, summaries in ALL GroupByRows are removed, when I want to remove them only in a single GroupByRow. So, if there are any GroupByRows collapsed, I can't see the summary for it.
Any suggestions?
Thanks, Mike and Michael, Mike's solution worked perfectly, apart of the discussed bug :)
This issue has been submitted to our developers for further review. The reference number for this item is 162971. A support case has also been opened for this issue with reference number CAS-130885-G5V5P1. You will receive more information on this item through the support case.
Xe Collons said:By the way, I have seen that, if I put InGroupByRows into the SummaryDisplayAreas and if the GroupBySummaryDisplayStyle is setted as SummaryCells with no indentation for the groupbyrows (IndentationGroupByRow = 0), I can't expand or collapse GroupByRows using the Expansion Indicator. If I change GroupBySummaryDisplayStyle into Text or Default, it works as charm.
This looks like a bug. The Summary element is covering up the expansion indicator element in this case, so it never receives a click. You can still expand/collapse the row by double-clicking. I'll ask Infragistics Developer Support to create a case for you and write this up for developer review so we can get it fixed.
Okay. So then really, the only thing you need to do is hide the summary cells in a GroupByRow when that row is expanded. This is a pretty simple CreationFilter.
this.ultraGrid1.CreationFilter = new GroupByRowSummaryCreationFilter();
public class GroupByRowSummaryCreationFilter : IUIElementCreationFilter { void IUIElementCreationFilter.AfterCreateChildElements(UIElement parent) { if (parent is GroupByRowUIElement) { UltraGridGroupByRow groupByRow = parent.GetContext(typeof(UltraGridGroupByRow)) as UltraGridGroupByRow; if (null != groupByRow && groupByRow.Expanded) { SummaryFooterUIElement summaryFooterUIElement = parent.GetDescendant(typeof(SummaryFooterUIElement)) as SummaryFooterUIElement; if (null != summaryFooterUIElement) { parent.ChildElements.Remove(summaryFooterUIElement); } } } } bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent) { // Do nothing return false; } }
Yes, "SummaryCells".
By the way, I have seen that, if I put InGroupByRows into the SummaryDisplayAreas and if the GroupBySummaryDisplayStyle is setted as SummaryCells with no indentation for the groupbyrows (IndentationGroupByRow = 0), I can't expand or collapse GroupByRows using the Expansion Indicator. If I change GroupBySummaryDisplayStyle into Text or Default, it works as charm.
Any suggestions on this?