I have set up columns with numbers to be able to support Summary Row Calculations via AllowRowSummaries (SingleSummaryBasedonDataType). Unfortunately I'm seeing weird behavior when I try to select a "Minimum" calculation for a summary row when all the cells in a particular column are empty (edge case..perhaps): the text shown isn't intuitive...like "0" or an empty cell. The text reads "Minimum =". I would like to have this be empty string, 0, or something else more intuitive (especially since none of the other options like "Maximum", "Average", etc behave like "Minimum" in this scenario.
I tried to track down why this was happening and found that the event I was listening for in order to format the result from the calculation wasn't being fired in the "Minimum" case (though it is fired for "Maximum", etc). I also noticed that for empty cells in a column calculation, Maximum has the following: gridname.Rows.SummaryValues.All[index of Max].Value == System.DBNull....while on the other hand, Minimum has the following gridname.Rows.SummaryValues.All[index of Min].Value == null. It's a little strange that Max and Min would behave differently in such a similar situation. Does anybody have an idea why I'm seeing this behavior?
I appreciate the support :)
Hi,
I tried this out and am not getting the behavior you describe regarding the display. I get the same display for both Maximum and Mininum summaries. They both show up with blanks for the value when the column contains no data.
Are your summaries both being applied to the same column? I am wondering if maybe your Maximum summary is being applied to a column that is a different data type or maybe has a different default value than the column that the Minimum Summary applies to. That might account for the different behavior.
If they are both on the same column, then there must be some other difference in the Summary itself. Are you setting the DisplayFormat?
What version of the grid are you using? I did my testing with the oldest supported version which is currently v10.3.
In any case, I do see that the SummaryValueChanged event is not firing for the Minimum summary. This is clearly a bug. My guess is that the value starts out null and since there's no data in the column, it never changes from null and therefore there is technically no summary value change. But it seems like the grid should consider the first calculation of that value as a change, regardless.
I'm going to forward this thread over to Infragistics developer support and ask them to create a case for you so we can have this issue looked into.
Charles,
I will submit this as a development issue and you will receive more information through the Customer Help case.
Michael S.