Hi,
we have a Grid with column summaries which is grouped by a column and therefore there is a groupby row with a text.
This text is, as far as we found out, determined by the GroupByDescriptionMask property, which has (should have) a default value of "[caption] : [value] ([count] [count,items,item,items])". The last part is what we need some information about.
The text currently looks like "Customer : SomeCustomer (1 Item) in € 100.000, in € 52.000, in € 687.000,..." (the list goes on for every summarized column. As it seems, the order of those summaries displayed in the groupby row does not match the order of the summarizes columns. I attached an image where you can see that both aren't in the same order.
What we need to know is: How is the order determined in which the summaries are displayed in the groupby row and, if possible, how can we tell the groupby row to display those values in the same order as the columns are in the grid?
Thanks in Advance,
NDE
P.S.: We currently use Version 11.2 Service Release 20112-2135
Hello,
What you could do in your case is to try to add in the summaries collection, the desired summaries in the appropriate order:
e.Layout.Bands[0].Summaries.Add(SummaryType, UltraGridColumn);
If you do that your summaries should be displayed in the order of which you have added them (if you added them through the designer, you have to rearrange the designer code so that they are in the order you desire).
Please let me know if my suggestion helped you solve your issue.
I am waiting for your response.
Hello Dimitar,
so far we haven't tested this possibility because it would result in much of work to ensure that the order is always correct (which affects column hiding/displaying, column reorder, column group reorder, etc. which can be done by the user as well).
If this is the only way to make both have the some order, we will (unfortunately) have to implement it that way, but we hope there is another.
We appreciate any further ideas.
Thanks in advance,
If my initial suggestion is not applicable in your case there is an alternative solution. You could use the SummaryValueChanged() and AfterColPosChanged() events of the grid to reorder the summaries. To do this you need to get all the summaries from the ultraGrid1.DisplayLayout.Bands[0].Summaries collection in a list and then you have to remove all existing summaries in the band. After that you could order the list by the visible position of their headers and re-add them to the summary collection of the band. This way, whenever the user adds a summary or reorders the columns, the summaries will be displayed in the correct order.
I have attached a sample, which demonstrates my suggestion.
Feel free to let me know if you have any additional questions.
thank you very much for your time/help and for the sample project.
While this works, we have found out about a better solution to this display problem.Just yesterday we found out about the GroupBySummaryDisplayStyle Property and setting it to SummaryCellsAlwaysBelowDescription or SummaryCells gives us not only the summaries in order but also the possibility to apply some formatting.