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

Remove Aggregates from Group Headers

2 Answers 160 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raymond
Top achievements
Rank 1
Raymond asked on 06 Nov 2013, 09:24 PM
My grid is displaying aggregate results in the group headers which I want to remove; I only wish to display the aggregates in the column footers.  My WPF form uses the following;

<Window x:Class="MainWindow"
    xmlns:local="clr-namespace:ProjectRigAnalysis"
    Title="MainWindow"
    Height="auto"
    Width="auto"
    WindowStartupLocation="CenterScreen">
     
    <Window.Resources>
        <local:NumberToFixedStringConverter x:Key="NumberToFixedString" />
        <local:GridViewTemplateSelector x:Key="gridViewTemplateSelector">
            <local:GridViewTemplateSelector.belowRequirement>
                <DataTemplate>
                    <TextBlock Text="{Binding RequiredRigYrs, Converter={StaticResource NumberToFixedString}, ConverterParameter=0.00}"
                        Foreground="Red"
                        TextAlignment="Right" />
                </DataTemplate>
            </local:GridViewTemplateSelector.belowRequirement>
            <local:GridViewTemplateSelector.meetsRequirement>
                <DataTemplate>
                    <TextBlock Text="{Binding RequiredRigYrs, Converter={StaticResource NumberToFixedString}, ConverterParameter=0.00}"
                        Foreground="Green"
                        TextAlignment="Right" />
                </DataTemplate>
            </local:GridViewTemplateSelector.meetsRequirement>
        </local:GridViewTemplateSelector>
        <Style TargetType="telerik:GroupHeaderRow">
            <Setter Property="ShowGroupHeaderColumnAggregates" Value="False" />
            <Setter Property="ShowHeaderAggregates"  Value="False" />
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <telerik:RadGridView Name="rgvWell"
            Grid.Row="0"
            Grid.Column="0"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Margin="5"
            telerik:StyleManager.Theme="Office_Blue"
            AutoGenerateColumns="False"
            ShowColumnFooters="True"
            ShowGroupFooters="True"
            RowIndicatorVisibility="Collapsed"
            ItemsSource="{Binding}">
            <telerik:RadGridView.GroupDescriptors>
                <telerik:GroupDescriptor Member="Period" SortDirection="Ascending" />
                <telerik:GroupDescriptor Member="Project" SortDirection="Ascending" />
            </telerik:RadGridView.GroupDescriptors>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Project" UniqueName="Project" IsReadOnly="True" />
                <telerik:GridViewDataColumn Header="Rig Type" UniqueName="RigType" IsReadOnly="True" />
                <telerik:GridViewDataColumn Header="Period" UniqueName="Period" IsReadOnly="True" />
                <telerik:GridViewDataColumn Header="Requirement" UniqueName="RequiredRigYrs" IsReadOnly="True" CellTemplateSelector="{StaticResource gridViewTemplateSelector}" >
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="Requirement: " ResultFormatString="{} {0:0.00}" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Capability" UniqueName="AvailableRigYrs" IsReadOnly="False" DataFormatString="{} {0:0.00}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="Capability: " ResultFormatString="{} {0:0.00}" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>

My problem is that it appears to be ignoring the style in Windows.Resources and displays the aggregated data in the group headers.

  

2 Answers, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 07 Nov 2013, 07:32 AM
Hi Raymond,

 

You may check the following forum thread, where the same topic was already discussed. 


Regards,
Vanya Pavlova
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Raymond
Top achievements
Rank 1
answered on 07 Nov 2013, 08:28 PM
Thanks Vanya,

I had searched the forum but for some reason didn't see this post.
Tags
GridView
Asked by
Raymond
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Raymond
Top achievements
Rank 1
Share this question
or