Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
400
Differents summaries in differents groupyrows in UltraGrid?
posted

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?

  • 469350
    Offline posted

    Hi,

    You are right, you won't be able to do this using any property settings on the grid, because they affect the entire band.

    There might be another way to achieve this, but how you do it depends on whether you are displaying the summaries in the GroupByRow as columns or as part of the description. Are you setting GroupBySummaryDisplayStyle?

    • 400
      posted in reply to Mike Saltzman

      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?

      • 400
        posted in reply to Mike Saltzman

        Worked perfectly! Thanks again :)

        • 469350
          Verified Answer
          Offline posted in reply to Xe Collons

          Hi,

          Okay, thanks for the clarification. You are correct, this would require a CreationFilter. I whipped up a quick sample for you and attached it here.

          WindowsFormsApplication7.zip
          • 400
            posted in reply to Mike Saltzman

            One groupbyrow with some rows as child rows, for example, and another groupbyrow with some other rows. Grouped by one column, column "Type", the first is "Type 1" and the second, "Type 2".

            Those groupedbyrows have summaries at their footer (SummaryDisplayAreas.GroupByRowsFooter). Imagine that I have 10 columns, and, because of it, I have 10 summaries, one per column. So, in the second group, I want to remove 5 summaries without removing them from the first.



            Is it possible? How? I imagine that it can be achieved via a Creation Filter like the other, but I can't find the parent of this summaryfootergroup. Thanks.

            • 469350
              Offline posted in reply to Xe Collons

              Hi,

              I'm having trouble understanding the scenario.

              Xe Collons said:
              I have two groupedbyrows in a grid.

              Do you mean you have two actual rows? Or are you talking about two levels of grouping (grouping by two different columns)?

              I think it would be helpful if you posted a screen shot so I can see what the grid looks like and exactly which summaries you want to remove.

              • 400
                posted in reply to Xe Collons

                Sorry for the "upping" of this post, but I have another question:

                I have two groupedbyrows in a grid. Both of them work with summaryfooters per groupbyrow. I want to remove 5 concrete summaries(from 18) from the second groupbyrow, at the bottom of all rows inside the group, without removing them on the first.

                For testing purposes, I thought at first that I could remove all the SummaryFooterUIElements to try(I imagine that SummaryValues will be child of this elements), so, watching who were the parents of these elements, I arrived to the RowColRegionIntersectionUIElement. I tried to remove the SummaryFooters from these elements like this in a creationfilter:

                if (parent is RowColRegionIntersectionUIElement)
                {
                        SummaryFooterUIElement summaryFooterUIElement = parent.GetDescendant(typeof(SummaryFooterUIElement)) as SummaryFooterUIElement;
                        if (null != summaryFooterUIElement)
                        {
                        parent.ChildElements.Remove(summaryFooterUIElement);
                        }
                }

                But it only removes them from the first groupbyrow. Any help? Thanks :9