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

GridViewGroupRow Styling Aggregates not showing up

5 Answers 187 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Boots
Top achievements
Rank 1
Boots asked on 08 Apr 2010, 09:11 PM
Hello,

I started updating our styles earlier today an i ran into a problem with the GridViewGroupRow Style. For some reason i cant get it to display the aggregates.

Here is the style that I'm getting from blend.
<Style x:Key="GridViewGroupRowStyle1" TargetType="{x:Type telerik:GridViewGroupRow}"
            <Setter Property="Template"
                <Setter.Value> 
                    <ControlTemplate TargetType="{x:Type telerik:GridViewGroupRow}"
                        <Grid x:Name="PART_GroupExpanderGrid" Background="{TemplateBinding Background}"
                            <Grid.ColumnDefinitions> 
                                <ColumnDefinition Width="Auto"/> 
                                <ColumnDefinition Width="Auto"/> 
                                <ColumnDefinition Width="*"/> 
                            </Grid.ColumnDefinitions> 
                            <Grid.RowDefinitions> 
                                <RowDefinition x:Name="PART_HeaderRow" MinHeight="25"/> 
                                <RowDefinition x:Name="ContentRow"/> 
                            </Grid.RowDefinitions> 
                            <Border x:Name="ToggleButtonBorder" Grid.Column="2" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" BorderBrush="#FF848484" BorderThickness="0,0,0,1"
                                <Border x:Name="ToggleButtonInnerBorder" BorderBrush="White" BorderThickness="1"
                                    <Grid> 
                                        <Grid.ColumnDefinitions> 
                                            <ColumnDefinition Width="25"/> 
                                            <ColumnDefinition Width="Auto"/> 
                                            <ColumnDefinition Width="*"/> 
                                        </Grid.ColumnDefinitions> 
                                        <Border HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="2"
                                            <telerik:AggregateResultsList HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsTabStop="False"
                                                <telerik:AggregateResultsList.ItemTemplate> 
                                                    <DataTemplate> 
                                                        <telerik:GridViewAggregateResultCell IsTabStop="False" AggregateResult="{Binding}"
                                                            <telerik:StyleManager.Theme> 
                                                                <telerik:Office_BlackTheme/> 
                                                            </telerik:StyleManager.Theme> 
                                                        </telerik:GridViewAggregateResultCell> 
                                                    </DataTemplate> 
                                                </telerik:AggregateResultsList.ItemTemplate> 
                                                <telerik:AggregateResultsList.ItemsPanel> 
                                                    <ItemsPanelTemplate> 
                                                        <StackPanel IsItemsHost="True" Orientation="Horizontal"/> 
                                                    </ItemsPanelTemplate> 
                                                </telerik:AggregateResultsList.ItemsPanel> 
                                            </telerik:AggregateResultsList> 
                                        </Border> 
                                        <Border x:Name="IconOuterBorder" HorizontalAlignment="Stretch" Margin="-1,-1,0,-2" Background="{TemplateBinding Background}" BorderBrush="#FF848484" BorderThickness="0,0,0,1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                                            <Border x:Name="IconInnerBorder" BorderBrush="White" BorderThickness="1,1,0,1"
                                                <Path x:Name="ExpanderButton" Fill="Black" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="7" Height="5" RenderTransformOrigin="0.5,0.5" Grid.Column="0" Data="M0,0L1,0 2,0 2,0.99999991 3,0.99999991 3,2 4,2 4,0.99999991 5,0.99999991 5,0 5.9999999,0 7,0 7,0.99999991 5.9999999,0.99999991 5.9999999,2 5,2 5,3 4,3 4,4 3,4 3,3 2,3 2,2 1,2 1,0.99999991 0,0.99999991z"
                                                    <Path.RenderTransform> 
                                                        <RotateTransform/> 
                                                    </Path.RenderTransform> 
                                                </Path> 
                                            </Border> 
                                        </Border> 
                                        <ToggleButton x:Name="HeaderButton" Background="{TemplateBinding Background}" Opacity="0" Grid.Column="0" Grid.ColumnSpan="3" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"/> 
                                        <ToggleButton Background="{TemplateBinding Background}" BorderBrush="{x:Null}" BorderThickness="0" Padding="0,0,10,0" Grid.Column="1" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                                            <ToggleButton.Style> 
                                                <Style TargetType="{x:Type ToggleButton}"
                                                    <Setter Property="Template"
                                                        <Setter.Value> 
                                                            <ControlTemplate TargetType="{x:Type ToggleButton}"
                                                                <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                                                                    <ContentPresenter Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/> 
                                                                </Border> 
                                                            </ControlTemplate> 
                                                        </Setter.Value> 
                                                    </Setter> 
                                                    <Setter Property="HorizontalContentAlignment" Value="Left"/> 
                                                    <Setter Property="VerticalContentAlignment" Value="Center"/> 
                                                    <Setter Property="Padding" Value="9,0,0,0"/> 
                                                </Style> 
                                            </ToggleButton.Style> 
                                            <ContentPresenter Margin="0,0,10,0" VerticalAlignment="Center" Grid.Column="1" Content="{TemplateBinding GroupViewModel}" ContentTemplate="{TemplateBinding GroupHeaderTemplate}"/> 
                                        </ToggleButton> 
                                    </Grid> 
                                </Border> 
                            </Border> 
                            <Border x:Name="PART_IndicatorPresenter" VerticalAlignment="Stretch" Width="25" Visibility="{TemplateBinding RowIndicatorVisibility}" Grid.Column="0" BorderBrush="#FF848484" BorderThickness="0,0,1,1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                                <Border Background="#FFE4E4E4" BorderBrush="White" BorderThickness="1"/> 
                            </Border> 
                            <telerik:IndentPresenter Background="{TemplateBinding Background}" IsTabStop="False" Grid.Column="1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" IndentLevel="{TemplateBinding Level}"
                                <telerik:StyleManager.Theme> 
                                    <telerik:Office_BlackTheme/> 
                                </telerik:StyleManager.Theme> 
                            </telerik:IndentPresenter> 
                            <Border x:Name="Content" Visibility="Collapsed" Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="1"
                                <StackPanel> 
                                    <telerik:GridViewVirtualizingPanel x:Name="PART_GridViewVirtualizingPanel"/> 
                                    <telerik:GridViewGroupFooterRow x:Name="Footer" IsTabStop="False"
                                        <telerik:StyleManager.Theme> 
                                            <telerik:Office_BlackTheme/> 
                                        </telerik:StyleManager.Theme> 
                                    </telerik:GridViewGroupFooterRow> 
                                </StackPanel> 
                            </Border> 
                            <Border x:Name="BottomBorder" VerticalAlignment="Bottom" Visibility="Collapsed" Grid.Column="2" Grid.Row="1" BorderBrush="#FF848484" BorderThickness="0,0,0,1"/> 
                        </Grid> 
                        <ControlTemplate.Triggers> 
                            <Trigger Property="IsExpanded" Value="True"
                                <Trigger.EnterActions> 
                                    <BeginStoryboard> 
                                        <Storyboard> 
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="180"/> 
                                            </DoubleAnimationUsingKeyFrames> 
                                        </Storyboard> 
                                    </BeginStoryboard> 
                                </Trigger.EnterActions> 
                                <Trigger.ExitActions> 
                                    <BeginStoryboard> 
                                        <Storyboard> 
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/> 
                                            </DoubleAnimationUsingKeyFrames> 
                                        </Storyboard> 
                                    </BeginStoryboard> 
                                </Trigger.ExitActions> 
                                <Setter Property="Visibility" TargetName="BottomBorder" Value="Visible"/> 
                                <Setter Property="Visibility" TargetName="Content" Value="Visible"/> 
                                <Setter Property="BorderThickness" TargetName="IconOuterBorder" Value="0"/> 
                                <Setter Property="BorderThickness" TargetName="IconInnerBorder" Value="1,1,0,0"/> 
                            </Trigger> 
                        </ControlTemplate.Triggers> 
                    </ControlTemplate> 
                </Setter.Value> 
            </Setter> 
            <Setter Property="GroupHeaderTemplate"
                <Setter.Value> 
                    <DataTemplate> 
                        <ContentPresenter Content="{Binding Header}"/> 
                    </DataTemplate> 
                </Setter.Value> 
            </Setter> 
            <Setter Property="Background" Value="#FFE4E4E4"/> 
            <Setter Property="BorderBrush" Value="#FFCBCBCB"/> 
            <Setter Property="BorderThickness" Value="0"/> 
            <Setter Property="VerticalContentAlignment" Value="Center"/> 
            <Setter Property="HorizontalContentAlignment" Value="Left"/> 
            <Setter Property="Padding" Value="10,0,0,0"/> 
            <Setter Property="SnapsToDevicePixels" Value="True"/> 
        </Style> 

Any ideas what I'm doing wrong?

Thanks Much,
~Boots

5 Answers, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 09 Apr 2010, 08:25 AM
Hello Boots,

There currently is an issue which causes the aggregates to disappear when applying a template to the group row. We are making a best effort to include a fix for this in the upcoming service pack next week.

There is also a public PITS item created in case you want to track the progress on this matter.

I apologize for the inconvenience.

All the best,
Kalin Milanov
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
Boots
Top achievements
Rank 1
answered on 19 Nov 2010, 09:17 PM
Hi Kalin,

Has there been any update on this issue?

Thanks much,
~Boots
0
Kalin Milanov
Telerik team
answered on 25 Nov 2010, 11:06 AM
Hello Boots,

Unfortunately, we still have no resolution for the issue. For some reason Blend does not extract the template of the group row properly. We identify what was missing and we do have a workaround for the issue. 

There is a missing ItemsSource binding for the AggregatesResultList. Adding the following:
ItemsSource="{TemplateBinding AggregateResults}"
will resolve the issue.

I apologize for the inconvenience and I am most hopeful we will be able to include a fix soon. 

Regards,
Kalin Milanov
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Boots
Top achievements
Rank 1
answered on 01 Dec 2010, 09:02 PM
Hi Kalin,

Thank you for that work around. It works great. I was wondering if you know if it's possible to have the aggregates in the GridViewGroupRow line up with their corresponding column? Say in the event where there were 2 or more aggregates on that same column we'd just stack them on top of each other.

Any ideas on a starting point for this would be great.

Thanks Again,
~Boots

0
Maya
Telerik team
answered on 02 Dec 2010, 10:21 AM
Hi Boots,

For the time being there is no straight forward way to align the Aggregate Results in the Group Row.
As a workaround, you may predefine the GridViewGroupRowStyle and set it as the default one for your application. I am sending you a sample project illustrating the proposed solution. 
 

Greetings,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
GridView
Asked by
Boots
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Boots
Top achievements
Rank 1
Maya
Telerik team
Share this question
or