We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Calculating Difference/Ratio Between Two Summary Columns - but not summing

Hi, I just need a quick sanity check. My GroupingGrid needs to show the difference between two double cols, eg Col1 and Col2. I don''t actually need to show the record values - just the overal group totals. I started out using a DataColumn with an expression but this just summed up the values Should I use a Custom Summary derived from SummaryBase to keep a running total of Col1 and Col2 and then return a final value or is it more efficient to get into the TableControlPrepareViewStyleInfo (or similar event) and directly calculate the difference there Thanks, as usual :-) Jason

1 Reply

AD Administrator Syncfusion Team September 22, 2005 11:13 PM UTC

Jason, The easiest would be to add an expression column that does the diffenerence. You can sum up that column and hide it from the displayed columns and reference it only in your group caption. If totals for the columns are already generated then it would be slightly more efficient to handle QueryCellStyleInfo and do the calcuation there for the group caption only. But it will only be minor performnace gains. Stefan >Hi, > >I just need a quick sanity check. My GroupingGrid needs to show the difference between two double cols, eg Col1 and Col2. > >I don''t actually need to show the record values - just the overal group totals. I started out using a DataColumn with an expression but this just summed up the values > >Should I use a Custom Summary derived from SummaryBase to keep a running total of Col1 and Col2 and then return a final value or is it more efficient to get into the TableControlPrepareViewStyleInfo (or similar event) and directly calculate the difference there > >Thanks, as usual :-) > >Jason

Loader.
Live Chat Icon For mobile
Up arrow icon