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
2290
Problem with xamGrid Average Calculations
posted

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>

Parents Reply Children