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

Totals or Summary Row?

13 Answers 588 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.
Andrew
Top achievements
Rank 1
Andrew asked on 07 Apr 2009, 09:15 AM
Hi,

I've integrated grouping and aggregates into my silverlight grid.
This works fine and I have aggregated values on my group rows.
Now I would like to have one total (or summary) row for the whole grid.
How can I accomplish that? I can't see anything like the GridViewSummaryRowItem 
which I found in another forum for the winform controls.

Thx
 


13 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 08 Apr 2009, 08:19 AM
Hello Andrew,

We are working on this feature currently . We are targeting the Q2 release. Meanwhile I would recommend any external ( to the RadGridView) implementation e.g. user control to display the aggregates. Another dirty way is to include the aggregate data ( totals) as the last row in the original data. Since there are a lot of requests for this feature we have pushed it high priority and it is quite possible for it to appear as internal build even before the official Q2 release.

All the best,
Pavel Pavlov
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Richard
Top achievements
Rank 1
answered on 22 May 2009, 06:59 PM
Hi,

On that new feature being added in Q2.  Will it allow for different functions i.e. Sum, Avg, Min. Max, Count?  How will hierarchy be handled ?  Also, will this be implemented on the column header where clicking on an icon will provide a function list.  I hope so!

Thanks
Rich
0
Vlad
Telerik team
answered on 25 May 2009, 05:50 AM
Hi Richard,

You will have the ability to specify multiple column aggregates - for example you can have both Count and Max for a single column. We will do our best to provide runtime aggregate functions chooser however for the first version this feature will be "static" most probably. Aggregates will be calculated per GridViewDataControl and will work with unlimited levels of hierarchy.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Andrew
Top achievements
Rank 1
answered on 25 May 2009, 09:14 AM
Hi Vlad,

I've noticed your last post on that issue and I'm really looking forward to get this feature.
Do you have any idea when it will be released? Date of Q2 or maybe before as internal build?
Pavel Pavlov mentioned before that it is possible to appear as internal build before official Q2 release.

Many Thanks for that information.
Andrew
0
Vlad
Telerik team
answered on 27 May 2009, 08:27 AM
Hello Andrew,

The release is scheduled for the end of June - we will do our best to provide early demo as soon as possible.

All the best,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
rb
Top achievements
Rank 1
answered on 05 Jun 2009, 04:57 PM
hi,

do you have any update on this one? our customers want this function more than anything.

please share any code if possible.

thanks
ramu
0
Vlad
Telerik team
answered on 08 Jun 2009, 06:01 AM
Hello ramu,

Here is an example code:

C#
using System.Windows; 
using System.Linq; 
using System; 
using Examples.GridView; 
 
namespace Telerik.Windows.Examples.GridView.WPF.Totals 
    /// <summary> 
    /// Interaction logic for Example.xaml 
    /// </summary> 
    public partial class Example 
    { 
        public Example() 
        { 
            InitializeComponent(); 
 
            RadGridView1.ItemsSource = new MyBusinessObjects().GetData(1000); 
        } 
 
        private void Button_Click(object sender, RoutedEventArgs e) 
        { 
            MessageBox.Show(RadGridView1.AggregateResults["MinUnitPrice"].FormattedValue.ToString()); 
        } 
    } 
 


XAML
<QuickStart:Example x:Class="Telerik.Windows.Examples.GridView.WPF.Totals.Example" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:QuickStart="clr-namespace:Telerik.Windows.QuickStart;assembly=Telerik.Windows.QuickStart" 
        xmlns:grid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
        xmlns:gridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView" 
        xmlns:data="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data"
    <Grid> 
        <grid:RadGridView x:Name="RadGridView1" ShowColumnFooters="True" AutoGenerateColumns="False"
            <grid:RadGridView.Columns> 
                <grid:GridViewDataColumn Header="ID" DataMemberBinding="{Binding ID}"
                    <grid:GridViewDataColumn.AggregateFunctions> 
                        <data:CountFunction Caption="Count: " /> 
                    </grid:GridViewDataColumn.AggregateFunctions> 
                </grid:GridViewDataColumn> 
                <grid:GridViewDataColumn Width="*" Header="Name" DataMemberBinding="{Binding Name}"
                    <grid:GridViewDataColumn.AggregateFunctions> 
                        <data:MinFunction FunctionName="MinUnitPrice" ResultFormatString="{}{0:c}" SourceField="UnitPrice" /> 
                    </grid:GridViewDataColumn.AggregateFunctions> 
                    <grid:GridViewDataColumn.Footer> 
                        <Button Content="Show smallest UnitPrice" Click="Button_Click" /> 
                    </grid:GridViewDataColumn.Footer> 
                </grid:GridViewDataColumn> 
                <grid:GridViewDataColumn Width="200" Header="UnitPrice" DataMemberBinding="{Binding UnitPrice}"
                    <grid:GridViewDataColumn.AggregateFunctions> 
                        <data:SumFunction Caption="Sum: " ResultFormatString="{}{0:c}" SourceField="UnitPrice" /> 
                        <data:AverageFunction Caption="Average:" ResultFormatString="{}{0:c}" SourceField="UnitPrice" /> 
                    </grid:GridViewDataColumn.AggregateFunctions> 
                    <grid:GridViewDataColumn.Footer> 
                        <StackPanel Orientation="Vertical" Margin="5"
                            <TextBlock Text="Custom footer with aggregates:" Margin="0,0,0,5" /> 
                            <gridView:AggregateResultsList ItemsSource="{Binding}"  VerticalAlignment="Center" Grid.Column="4"
                                <ItemsControl.ItemTemplate> 
                                    <DataTemplate> 
                                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
                                            <TextBlock TextAlignment="Right" VerticalAlignment="Center" 
                           Text="{Binding Caption}" Margin="0,0,5,0" /> 
                                            <TextBlock TextAlignment="Right" VerticalAlignment="Center" 
                           Text="{Binding FormattedValue}"/> 
                                        </StackPanel> 
                                    </DataTemplate> 
                                </ItemsControl.ItemTemplate> 
                                <ItemsControl.ItemsPanel> 
                                    <ItemsPanelTemplate> 
                                        <StackPanel Orientation="Vertical" /> 
                                    </ItemsPanelTemplate> 
                                </ItemsControl.ItemsPanel> 
                            </gridView:AggregateResultsList> 
                        </StackPanel> 
                    </grid:GridViewDataColumn.Footer> 
                </grid:GridViewDataColumn> 
                <grid:GridViewDataColumn Width="200" Header="Date" DataMemberBinding="{Binding Date}"
                    <grid:GridViewDataColumn.AggregateFunctions> 
                        <data:MinFunction Caption="Min: " ResultFormatString="{}{0:d}" SourceField="Date" /> 
                        <data:MaxFunction Caption="Max: " ResultFormatString="{}{0:d}" SourceField="Date" /> 
                    </grid:GridViewDataColumn.AggregateFunctions> 
                </grid:GridViewDataColumn> 
            </grid:RadGridView.Columns> 
        </grid:RadGridView> 
    </Grid> 
</QuickStart:Example> 
 


and the result you can find attached as screenshot.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
rb
Top achievements
Rank 1
answered on 08 Jun 2009, 05:18 PM
Hi,

I dont see the AggregateFunctions attached property. Is there a newer dll that I need for RadGridView?

thanks
ramu.
0
Vlad
Telerik team
answered on 09 Jun 2009, 05:13 AM
Hello ramu,

Please check my reply to Andrew.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Erez
Top achievements
Rank 1
answered on 12 Jun 2009, 12:52 PM
Hello,

Same subject- will it enable us to perform a kind of a 'sumif' function so that only rows that apply to a certain criteria will
be included in the result ? (for example, based on a value in one of the columns of a row).

Thanks,

Erez

0
Hristo Deshev
Telerik team
answered on 15 Jun 2009, 09:15 AM
Hi Erez,

Unfortunately, no. We will not be providing a "SumIf" function. You can achieve a similar effect by filtering the grid. Aggregates will be calculated only for rows that pass the filter condition.

Best wishes,
Hristo Deshev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Prashant goyani
Top achievements
Rank 1
answered on 07 Jul 2009, 05:32 PM
Hi..

I have to Disply Sum of three Column in to last single row..but in telerik gridview its diplay in different row..is there any solution that i can display  multiple GridViewSummaryRowItem in a single row.

Thanks,
Prashant
0
Vlad
Telerik team
answered on 08 Jul 2009, 05:48 AM
Hi Prashant,

As far as I know GridViewSummaryRowItem is part of our WinForms - can you clarify?

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Richard
Top achievements
Rank 1
Vlad
Telerik team
Andrew
Top achievements
Rank 1
rb
Top achievements
Rank 1
Erez
Top achievements
Rank 1
Hristo Deshev
Telerik team
Prashant goyani
Top achievements
Rank 1
Share this question
or