Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > GridView > SumFunction not working

Answered SumFunction not working

Feed from this thread
  • Jeffrey Lewis avatar

    Posted on Dec 23, 2009 (permalink)

    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

    Reply

  • Answer Pavel Pavlov Pavel Pavlov admin's avatar

    Posted on Dec 28, 2009 (permalink)

    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.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Jeffrey Lewis avatar

    Posted on Dec 29, 2009 (permalink)

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

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


    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > GridView > SumFunction not working
Related resources for "SumFunction not working"

WPF Grid Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]