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
248
Is it possible to sum when sorting on multiple columns
posted

This question I think is a difficult one.

I have a grid attached to a datasource. I use the newest version of ultragrid.

I have a lot of things set in InitializeLayout, and I have implemented the multi sort column code in the AfterSortChange event and everything works fine. But now to the question. When you add a column to a group you can sum on another column for that group and you can place the sum where you like. I have set GroupBySummaryDisplayStyle, SummaryDisplayArea, BorderStyleSummaryValue. But the problem is that if you sort on one or more column, the sort is performed at group level. But what I wan't is "global" sort and also the summary. So I think I can't use grouping.

Here is an example what I wan't. The columns that are sorted is not fixed, and set by the user) The text Sumline is only by example.

The gris is sorted on Company and Customer. So when these two values changed as a group, we have to make a sumline.

Company     Customer          Invoice Amount

Comp 1        Cust 1              inv 1    10

Comp 1        Cust 1              inv 2    20

Sumline:                                        30

Comp 1        Cust 2             inv 3    45

Sumline:                                       45

Comp 1        Cust 3             inv 4    55

Sumline:                                       55

 Is this possible by triggering some event, or do I have to do it at data source level?