Aggregate Result Display

30 posts, 2 answers
  1. Matthew Calhoun
    Matthew Calhoun avatar
    6 posts
    Member since:
    Nov 2009

    Posted 03 Dec 2010 Link to this post

    Hi,

    I am wondering if there is a way to disable the results of aggregate functions from being displayed in the headers? Or if not, can the results line up in the proper columns (instead of free-form text next to the header)?

    Thanks,
    Matt
  2. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 03 Dec 2010 Link to this post

    Hello Matthew Calhoun,

    You may use the ShowHeaderAggregates Property and set it to "False". You may either set it as an implicit style targeting all grids:

    <Grid.Resources>
        <Style TargetType="telerik:GridViewGroupRow">
            <Setter Property="ShowHeaderAggregates" Value="False"/>
        </Style>
    </Grid.Resources>

    Or define it explicitly using the GroupRowStyle property of the grid:
    <Grid.Resources>
        <Style x:Key="MyGroupRowStyle" TargetType="telerik:GridViewGroupRow">
            <Setter Property="ShowHeaderAggregates" Value="False"/>
        </Style>
    </Grid.Resources>
    <telerik:RadGridView GroupRowStyle="{StaticResource MyCustomGroupRowStyle}">

      

    All the best,
    Maya
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
  4. Matthew Calhoun
    Matthew Calhoun avatar
    6 posts
    Member since:
    Nov 2009

    Posted 03 Dec 2010 Link to this post

    Thanks Maya!

    Just for curiosity, is there a way to align the aggregrates to the proper columns?

    So, when grouped by year and summing Cost and Price, instead of:

    Year                                                    Cost        Price
    Year 1 $100 $200

    I would want:

    Year                                                    Cost            Price
    Year 1                                                 $100            $200

    Thanks,
    Matt
  5. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 03 Dec 2010 Link to this post

    Hi Matthew Calhoun,

    For the time being there is no straight forward way for achieving it. In order to get the desired view with aligned aggregates, you need to predefine the GridViewGroupRowStyle a bit. I am sending you a sample project illustrating the proposed solution.
    However, we do have plans on introducing this feature as a native one, but I cannot specify any time frame for that.
     

    Regards,
    Maya
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  6. Matthew Calhoun
    Matthew Calhoun avatar
    6 posts
    Member since:
    Nov 2009

    Posted 03 Dec 2010 Link to this post

    Wow...that's a lot of code vs something like 'ShowAggregratesInHeader="True"' :)

    Thanks for the workaround...it seems to be working for me. I'm looking forward to the "native" version of this!

    Take care,
    Matt
  7. jean-Marc
    jean-Marc avatar
    22 posts
    Member since:
    Jun 2010

    Posted 11 Mar 2011 Link to this post

    Hi,
    nice workaround while waiting for a native version.

    By changing slightly as follow we can even have the aggregates function aligned in the Group row even when expanded.
    Just thought some might prefer this version as I do.
    <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="aggregateResultsList">
                                        <DiscreteObjectKeyFrame KeyTime="0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Collapsed</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="toggleButton">
                                        <DiscreteObjectKeyFrame KeyTime="0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Visible</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PART_GridViewVirtualizingPanel">
                                        <DiscreteObjectKeyFrame KeyTime="0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Visible</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Footer">
                                        <DiscreteObjectKeyFrame KeyTime="0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Visible</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <DoubleAnimation Duration="0" To="-1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="ExpanderButton" d:IsOptimized="True"/>
                                     
                                     
                                </Storyboard>

    Regards
    Jean-Marc
  8. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 18 Apr 2011 Link to this post

    I don't find it in C# code
    How do you do that let say rgvTest.??? Where's the ShowHeaderAggregates ?
  9. Fabien
    Fabien avatar
    7 posts
    Member since:
    Aug 2011

    Posted 20 Sep 2011 Link to this post

    I tried this workaround but found a bug with windows7 theme : groupped rows doesn't expand anymore.

    Any solution ?

    Thanks

    Fabien
  10. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 21 Sep 2011 Link to this post

    Hi Fabien,

    I have tried to reproduce the issue, but still without any success. Would you take a look at the sample attached to verify whether you can get the same behavior on it ? 

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  11. Fabien
    Fabien avatar
    7 posts
    Member since:
    Aug 2011

    Posted 21 Sep 2011 Link to this post

    Hi Maya,

    I don't see in your sample the "align the aggregrates to the proper columns" feature.
    I use the code you provide in December, 2010 in this thread (attached file groupfooteringroupheader.zip) in my project to provide this feature.
    In my project i have

    StyleManager.ApplicationTheme = new Windows7Theme();
    in the MainPage constructor. With that line, groupped rows doesn't expand anymore.
    If i delete this line this works fine.
    It seems that the GridViewGroupRowStyle you provide is theme-specific, so can you give me this style that works with window7theme ?
    I'd be happy to do it if i had understood how you generate it (using blend ?)
    Thx,

    Fabien

     

  12. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 22 Sep 2011 Link to this post

    Hi Fabien,

    Can you try the sample attached in my last reply - SilverlightApplication9.zip ? Do you get the same behavior on it ?
     

    Kind regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  13. Fabien
    Fabien avatar
    7 posts
    Member since:
    Aug 2011

    Posted 22 Sep 2011 Link to this post

    Hi,

    Yes i have tried your sample. I thought you misunderstood my issue since your sample is not revelant because there is only one aggregate column and its the first. So it's hard to say if aggregates value in group headers are aligned with column header.
    But i putted your code in my project and it's working fine now with window7 theme (All aggregates value appears under their column). Thanks.
    But a issue remains : if i group by a column that contains text and doesn't have an aggregate function, this text doesn't appear in the group header. Any idea ?

    You can check attached file for expected result. With your sample, nothing appear on first column.

    I know that if you group by third Column (Phones), phone numbers in group headers will appear under "Name" Column, but i think it's better than not knowing the grouped value.

    Thank you for your patience,

    Fabien
  14. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 23 Sep 2011 Link to this post

    Hello Fabien,

     

    If you take a look at the modified version of your project you may see a single ContentPresenter which Visibility is set to Collapsed. Once you remove this setting from the ContentPresenter's definition you would be able to see the Group keys as well:

    <!--GroupHeader-->
                     
                            <ToggleButton  Grid.Column="1"
                                          grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                                          Background="Transparent" BorderThickness="0" BorderBrush="{x:Null}"
                                          Style="{StaticResource GridViewGroupToggleButtonStyle}"
                                          IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsTabStop="{TemplateBinding IsTabStop}">
                            <ContentPresenter  x:Name="contentPresenter" Grid.Column="1"  Content="{TemplateBinding GroupViewModel}" ContentTemplate="{TemplateBinding GroupHeaderTemplate}"/>
                            </ToggleButton>


    You may arrange this header in the way you need. 
    Hope this helps! 


    Kind regards,
    Vanya Pavlova
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  15. Fabien
    Fabien avatar
    7 posts
    Member since:
    Aug 2011

    Posted 23 Sep 2011 Link to this post

    Hi,

    Was watching around here but not seen the visibility attribute at the end of this long line.
    I have the expected result now. Thanx a lot.

    Fabien
  16. Megan Vee
    Megan Vee avatar
    40 posts
    Member since:
    Mar 2010

    Posted 03 Oct 2011 Link to this post

    Fabian - Apparently not yet: http://www.telerik.com/support/pits.aspx#/public/silverlight/4389
    please vote.

  17. Megan Vee
    Megan Vee avatar
    40 posts
    Member since:
    Mar 2010

    Posted 03 Oct 2011 Link to this post

    Is there a way to move the aggregate to the group header (e.g. next to the group name - e.g. A. Datum Corporation).
    And then remove the footer group?
    TIA.
    -M
  18. Fabien
    Fabien avatar
    7 posts
    Member since:
    Aug 2011

    Posted 03 Oct 2011 Link to this post

    Hi Megan,

    The last project posted by Maya aim to solve your problem. It worked for me, have you tried it ?
    The PITS issue that you mentioned is a feature request to have this functionality built-in.
    i.e. replace the 3 xaml files in Maya's workaround by a single property on gridView like 'ShowAggregatesInGroupHeader=true' - unfortunatly not scheduled yet (i have already voted).

    Fabien
  19. Megan Vee
    Megan Vee avatar
    40 posts
    Member since:
    Mar 2010

    Posted 03 Oct 2011 Link to this post

    Thanks Fabien - 
    I hadn't downloaded the 2nd file - I misunderstood it's purpose. Thanks, I'll take a look.
    -Megan
  20. Megan Vee
    Megan Vee avatar
    40 posts
    Member since:
    Mar 2010

    Posted 03 Oct 2011 Link to this post

    Fabien, Maya, et al - 
    The SilverlightApplication9 works in that it puts the aggregates above the group as requested.
    But now, how do I get the group name on that row as well?
    Any help is greatly appreciated.
    Thank you,
    Megan
  21. Fabien
    Fabien avatar
    7 posts
    Member since:
    Aug 2011

    Posted 03 Oct 2011 Link to this post

    See last post of Vanya Pavlova : Find the red line in your code and supress the visibility attribute.

  22. Megan Vee
    Megan Vee avatar
    40 posts
    Member since:
    Mar 2010

    Posted 04 Oct 2011 Link to this post

    Thanks Fabien! Apparently, I'm blind. :) That worked perfectly
    -M
  23. Megan Vee
    Megan Vee avatar
    40 posts
    Member since:
    Mar 2010

    Posted 04 Oct 2011 Link to this post

    Fabien - 
    One last question: If requested, were you able to resize the group column?
    e.g., in the screen shot, resize the name column so it isn't 'on top' of the Company aggregate.
    Almost there... :)
    -M
     
  24. Megan Vee
    Megan Vee avatar
    40 posts
    Member since:
    Mar 2010

    Posted 05 Oct 2011 Link to this post

    FYI - added this code to expand column so that grouped name is visible
    The border lines are still in the way, especially if more than one group is added, but it works for now.
    private void MyGridView_Grouping(object sender, GridViewGroupingEventArgs e)
            {
                //placing group or removing a group when there is more than one group already
                if (e.Action == GroupingEventAction.Place || CurrentGridView.GroupCount > 1)
                {
                    CurrentGridView.Columns[0].Width = 200;
                }
                else
                {
                    CurrentGridView.Columns[0].Width = 25;
                }
            }
    -M
  25. Dirk Liebich
    Dirk Liebich avatar
    17 posts
    Member since:
    Jun 2010

    Posted 31 Oct 2011 Link to this post

    Hey I know this is kind of the wrong place for it, but does anyone know if this will also work in WPF?  I've done my best to massage the code found in MainPage.xaml in the GroupHeaderInGroupFooter solution that was posted above, but I must be missing something.  This thread seems to be the furthest along for a solution to having the Aggregated Rows line up. 
  26. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 01 Nov 2011 Link to this post

    Hi Dirk Liebich,

    I have just replied to the other forum thread you posted on the same topic and attached a sample project illustrating the above-mentioned workaround for WPF.
    Let me know in case you need any further assistance.
     

    Greetings,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  27. Chandra
    Chandra avatar
    2 posts
    Member since:
    Jul 2012

    Posted 19 Sep 2012 Link to this post

    The example Worked fine for me, but there is a minor issue with expander image.
    If the RadGrid has many columns and I scroll the grid horizontally the expander image just scrolls out of screen to the left while the group name still holds it's place and also the group expands and collapses if I click on the blank area where the expander image was supposed to be.
    Please Help !
    Thanks-
    Chandra

  28. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 20 Sep 2012 Link to this post

    Hi Purna,

    Will it be possible to clarify a bit the case - which example you are referring to ? Furthermore, since this forum thread targets Silverlight, while the link in my last reply points out to our WPF forums, which platform are you working with ? What is your exact implementation ?  

    Greetings,
    Maya
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  29. Chandra
    Chandra avatar
    2 posts
    Member since:
    Jul 2012

    Posted 20 Sep 2012 Link to this post

    Thanx for replying, but I already tweaked the template and got the look I needed.
  30. Fabien
    Fabien avatar
    7 posts
    Member since:
    Aug 2011

    Posted 05 Nov 2012 Link to this post

    Hi again !

    It seems that IE10 users are reporting that numeric values are not correctly summed anymore. It still works fine on my IE 9.

    Any Idea ?

  31. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 06 Nov 2012 Link to this post

    Hello Fabien,

    Will it be possible to clarify a bit  - are your aggregates not calculated correctly ? Generally, this functionality should not be related to the version of the browser you are working with ? Is that reproducible with our demos ?  

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner