SumFunction not working

3 posts, 1 answers
  1. Jeffrey Lewis
    Jeffrey Lewis avatar
    12 posts
    Member since:
    Dec 2009

    Posted 23 Dec 2009 Link to this post

    I'm trying to use the RadGridView AggregateFunctions. I've tested Count, Min and Max functions successfully. However, when I try using SumFunction or AverageFunction, nothing is displayed on the column footer (including the previously added Count, Min, Max functions).

    I'm binding a DataTable to the grid from C# like this:

    this.radGrid1.ItemsSource = dtData; 

    This is the XAML for the GridView:

    <telerikGrid:RadGridView  
                x:Name="radGrid1" 
                MultipleSelect="True"  
                AutoGenerateColumns="False" 
                ShowColumnFooters="True" ShowGroupFooters="True"
     
                <telerikGrid:RadGridView.Columns> 
                     
                    <telerikGrid:GridViewDataColumn Header="AccountNo" DataMemberBinding="{Binding AccountNo}"
                        <telerikGrid:GridViewDataColumn.AggregateFunctions> 
                            <telerikData:CountFunction Caption="Count:" /> 
                        </telerikGrid:GridViewDataColumn.AggregateFunctions> 
                    </telerikGrid:GridViewDataColumn> 
                     
                    <telerikGrid:GridViewDataColumn Header="InvestmentCost" DataMemberBinding="{Binding InvestmentCost}" DataFormatString="{}{0:c}" TextAlignment="Right"
                        <telerikGrid:GridViewDataColumn.AggregateFunctions> 
                            <telerikData:SumFunction ResultFormatString="{}{0:c}" SourceField="InvestmentCost" /> 
                            <telerikData:MinFunction ResultFormatString="{}{0:c}" SourceField="InvestmentCost" /> 
                            <telerikData:MaxFunction ResultFormatString="{}{0:c}" SourceField="InvestmentCost" /> 
                        </telerikGrid:GridViewDataColumn.AggregateFunctions> 
                    </telerikGrid:GridViewDataColumn> 
                     
                </telerikGrid:RadGridView.Columns> 
            </telerikGrid:RadGridView> 

    Edit: 
    DataType for InvestmentCost column in dtData is Decimal.
    I'm using RadControls for WPF Q3 2009 SP1
  2. Answer
    Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 28 Dec 2009 Link to this post

    Hello Jeffrey Lewis,

    I have tried to reproduce the problem here but with my test project it seems to work ok .
    Please find the test project attached .  Maybe I am missing something to be able to  reproduce the problem ?

    Regards,
    Pavel Pavlov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Jeffrey Lewis
    Jeffrey Lewis avatar
    12 posts
    Member since:
    Dec 2009

    Posted 29 Dec 2009 Link to this post

    Thanks, got it to work following your example. The problem was I didn't put this in my SumFunction.

    SourceFieldType="{x:Type s:Decimal}"


Back to Top