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

Calculate Grand total of column which is calculated through IvalueConverter

4 Answers 99 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Wasif Jahangir
Top achievements
Rank 1
Wasif Jahangir asked on 12 Jul 2010, 02:07 PM
Hi all,
    i have a total column in my grid. which is calculated through IValueConverter. it works fine. i want to have its grand total in Footer. so how to do it?

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 12 Jul 2010, 02:23 PM
Hello,

 You can define your own custom footer similar to this demo.

Sincerely yours,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Wasif Jahangir
Top achievements
Rank 1
answered on 12 Jul 2010, 02:29 PM
My Case Is Different.
my Total field is calculated through IValueConverter and i want its sum in the footer. but here no such case is discussed.

<telerik:GridViewDataColumn IsReadOnly="True" Width="120" DataMemberBinding="{Binding Path=., Converter={StaticResource TotalConverter}}" Header="Total">

thisis my Xaml. so  can u help to how to calc its grand total ?
0
Vlad
Telerik team
answered on 12 Jul 2010, 02:31 PM
Hi,

 In your converter you can sum the result of all calculations and put this in desired column footer directly.

Regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Wasif Jahangir
Top achievements
Rank 1
answered on 13 Jul 2010, 05:59 AM
<telerik:GridViewDataColumn Width="120" DataMemberBinding="{Binding Path=., Converter={StaticResource ResourceKey=TotalConverter}, Mode=TwoWay}" Header="Total">
                            <telerik:GridViewDataColumn.Footer>
                                <StackPanel>
                                    <TextBlock VerticalAlignment="Center" Text="{Binding Path=.,Converter={StaticResource ResourceKey=GrandTotalConverter}, Mode=TwoWay}" />
                                </StackPanel>
                            </telerik:GridViewDataColumn.Footer>
                        </telerik:GridViewDataColumn>

here above mentioned is my code. my TotalConverter is called every time. but not the GrandTotalConverter. grandTotalConverter called only once the page get Loaded. not when i assign DataContext.
Tags
GridView
Asked by
Wasif Jahangir
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Wasif Jahangir
Top achievements
Rank 1
Share this question
or