This is a migrated thread and some comments may be shown as answers.

[Solved] How to retrieve the value shown in the Footer of RadGridView

1 Answer 105 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tai
Top achievements
Rank 1
Tai asked on 15 Jan 2011, 06:50 AM
Hi

below my PaymentAmount column of the radgridview, I have a footer which will have an aggregate function to calculate the sum of all PaymentAmount.

However, I don't know how to retrieved that result which showed in the footer.
Can you tell me how to do that in code behind? because i need that value sum to do something else
of course, i can do the For loop to retrieve the sum again but that's not really a good solution when the value is already available at the footer
thank you
<telerik:GridViewDataColumn DataMemberBinding="{Binding PaymentAmount,Mode=TwoWay}" Header="Payment" UniqueName="Payment"   DataFormatString="{}{0:c2}" >
                      <telerik:GridViewDataColumn.AggregateFunctions>
                          <telerik:SumFunction SourceField="PaymentAmount" ResultFormatString="{}{0:c2}" />
                      </telerik:GridViewDataColumn.AggregateFunctions>
                      <telerik:GridViewDataColumn.Footer>
                          <telerik:AggregateResultsList ItemsSource="{Binding}" />
                      </telerik:GridViewDataColumn.Footer>
                  </telerik:GridViewDataColumn>

1 Answer, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 17 Jan 2011, 07:46 AM
Hi Tai,

You may use the AggregateResults collection of the RadGridView. For further reference, please check our demo.

All the best,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Tai
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or