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

Totals in footer

3 Answers 126 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.
Dipti
Top achievements
Rank 1
Dipti asked on 15 Feb 2012, 01:44 PM
Hi,

I have used aggregate sum function in my grid to show the totals. I am using RadPager, and i display 10 records at a time.

the issue is the footer aggregate shows total of all records and not the records on current page.
i.e. if i have 25 records and currently 10 records are displayed, the footer shows sum of 25 records. We were expecting to see total of only 10 records as only 10 records are displayed currently.

Is this an issue or am i doing something wrong?

Regards,
Dipti

3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 15 Feb 2012, 01:56 PM
Hello,

You can try to pass in the input source collection to RadDataPager.Source and then bind RadGridView.ItemsSource to RadDataPager.PagedSource.

Please, read my blog for more info. It explains this alternative configuration.

Regards,
Ross
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Dipti
Top achievements
Rank 1
answered on 16 Feb 2012, 05:28 AM
Hi,

I have done as you have suggested.

This is what I have done:

XAML
<telerik:RadGridView x:Name="radGridViewCreditAnalysis" Width="470" Height="332" IsReadOnly="True" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False" ItemsSource="{Binding PagedSource, ElementName=rdPagerCreditAnalysis}"
 <telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Credit Limit" CellStyleSelector="{StaticResource creditLimitStyleSelector}" FooterTextAlignment="Right" Width="91" 
                    DataMemberBinding="{Binding Path=CreditLimit, Converter={StaticResource NegativeNumberConverter}}" IsFilterable="False" TextAlignment="Right" HeaderTextAlignment="Center"
                    HeaderCellStyle="{StaticResource IntranetGridViewHeaderCellStyle}" FooterCellStyle="{StaticResource IntranetGridViewFooterCellStyle}" >
                    <telerik:GridViewColumn.AggregateFunctions>
                        <telerik:SumFunction />
                    </telerik:GridViewColumn.AggregateFunctions>
                    <telerik:GridViewDataColumn.Footer>
                        <StackPanel Background="Transparent">
                            <telerik:AggregateResultsList ItemsSource="{Binding}" VerticalAlignment="Center">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
                                            <TextBlock VerticalAlignment="Center" Text="{Binding FormattedValue,Converter={StaticResource NegativeNumberConverter}}" />
                                        </StackPanel>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </telerik:AggregateResultsList>
                        </StackPanel>
                    </telerik:GridViewDataColumn.Footer>
                    <telerik:GridViewColumn.CellTemplateSelector>
                        <local:CreditTemplate>
                            <local:CreditTemplate.EmptyDataTemplate>
                                <DataTemplate>
                                    <TextBlock />
                                </DataTemplate>
                            </local:CreditTemplate.EmptyDataTemplate>
                        </local:CreditTemplate>
                    </telerik:GridViewColumn.CellTemplateSelector>
                </telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
        </telerik:RadGridView>
  
  
<telerik:RadDataPager x:Name="rdPagerCreditAnalysis" PageSize="{Binding pagesize}" IsTotalItemCountFixed="True" Source="{Binding int, ElementName=radGridViewCreditAnalysis}" />


C#:
this.rdPagerCreditAnalysis.PageSize = 10;
this.rdPagerCreditAnalysis.Source = listUtilization;

But the total on each page is same and equal to total of the entire collection.

Thanks
0
Dipti
Top achievements
Rank 1
answered on 28 Feb 2012, 10:35 AM
Telerik team,
Please help, I've given my code in previous post.

Regards,
Dipti
Tags
GridView
Asked by
Dipti
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Dipti
Top achievements
Rank 1
Share this question
or