Hi All,
I recently started using Infragistics controls and I've got a UltraWinGrid in NetAdvantage 2008 Vol 2 where I have column summaries configured. If rows in a column are null (never assigned anything), it screws up the summary 'average/min' calculations since it appears these cells are implied to be '0'.
Is there anyway to get a proper calculation of summaries like 'count/average/min' when there are null cells? Or perhaps to populate the 'dead' cells with some _invisible_ constant to prevent them from being used in the calculations?
Thanks!
Corey.
Hi Corey,
How are you doing the summaries? Are you using a Formula or one of the built-in summary types?
The grid doesn't really have any way to know whether or not empty cells should be included in a summary calculation or not. So it assumes they do.
If you are using the built-in summaries, then you would get around this by using a custom summary and writing your own ICustomSummaryCalculator.
If you are using formulas, you will need to create your own functions that ignore empty values.
Thanks for the reply, Mike.
Yes, I'm using the built-ins - I'm only interested in 'sum' at this stage. I took your advice and created a class derived from ICustomSummaryCalculator. All the samples that I have seen, however, seem to just return one single value. I am interested in summations for every column that I add the Summary to.
I'm assuming the proper place to do the summation is in AggregateCustomSummary, but that method is row based. I can build up the column sums easily enough as the rows are processed, but how to then get the column totals to be populated in the summation line in the grid? Does EndCustomSummary somehow set and return the new summary row? Or is the summary info yet another 'row'?