Hi All,
I am using MVVM and display records in xamGrid, i apply grouping on one column and display average of grid columns in bottom or every group. I have some null values in database and in grid these values are empty. When average is calculated i don't include these empty values in average calculations.Suppose i have 4 rows in one group and this group contains only one row value. Currently system calculated average like this, Sum of values of all the rows and divided by no of all rows. But i want sum of only those rows that contains values and divided by no of rows that contains values, not all rows, and do not show 0.00% if all rows are empty. For further explanation i attached the snapshot. My XAML Is following for display average summary in xamGrid.
<ig:XamGrid.SummaryRowSettings> <ig:SummaryRowSettings AllowSummaryRow="Bottom" /> </ig:XamGrid.SummaryRowSettings><ig:XamGrid.GroupBySettings>
<ig:TextColumn Key="StdOverUnderValuation" HeaderText="STD Over(under)valuation" FormatString="{}{0:P2}"> <ig:TextColumn.SummaryColumnSettings> <ig:SummaryColumnSettings> <ig:SummaryColumnSettings.SummaryOperands> <ig:AverageSummaryOperand IsApplied="True" RowDisplayLabel="Average " FormatString="{}{0:P2}"/> </ig:SummaryColumnSettings.SummaryOperands> </ig:SummaryColumnSettings> </ig:TextColumn.SummaryColumnSettings></ig:TextColumn>
Hello Abu,
Thank you for your question.
In this case the summary function needs to be customized, so it can best fit your needs. Please take a look at the following link explaining how to create a custom summary function: http://help.infragistics.com/NetAdvantage/Silverlight/2012.2/CLR4.0/?page=xamGrid_Create_a_Custom_Summary.html
Please let me know if this works for you.
Best regards,
Anatoli Iliev