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

[Solved] Applying 'GroupFooterRowStyle' style causes aggregate rows to dissappear after grouping...

3 Answers 168 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.
Rob
Top achievements
Rank 1
Rob asked on 24 Nov 2010, 09:32 PM
Hi,

I have attached a picture of a problem we're seeing in our application. We are using the latest release (last week's Q3).  I have a sample project that I can send along if you like.  For now I can just copy the code into here... it's small...

The problem seems to be related to applyin a 'GroupFooterRowStyle' to the RadGridView.  If I group on some columns (sometimes 1, sometimes more than 1), the total rows dissappear until you scroll the grid.  I initially thought I had done something with my styles, but I have even managed to replicate it with just the default Blend generated style...


<UserControl    x:Class="SilverlightApplication117.MainPage"    
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
>
      
    <UserControl.Resources>
        <SolidColorBrush x:Key="ControlInnerBorder" Color="Pink"/>
        <SolidColorBrush x:Key="GridView_RowIndicatorCellBackground" Color="Purple"/>
        <telerik:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <telerik:Office_BlackTheme x:Key="Theme"/>
        <DataTemplate x:Key="GridViewGroupFooterIndentCellDataTemplate">
            <telerik:GridViewGroupFooterIndentCell telerik:StyleManager.Theme="{StaticResource Theme}"/>
        </DataTemplate>
        <ControlTemplate x:Key="GridViewGroupFooterRowTemplate" TargetType="telerik:GridViewGroupFooterRow">
            <Border x:Name="PART_GroupFooterRowBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                <telerik:SelectiveScrollingGrid>
                    <telerik:SelectiveScrollingGrid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </telerik:SelectiveScrollingGrid.ColumnDefinitions>
                    <Border x:Name="PART_IndicatorPresenter" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,0" Grid.Column="0" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{TemplateBinding RowIndicatorVisibility}" VerticalAlignment="Stretch" Width="25">
                        <Border BorderBrush="{StaticResource ControlInnerBorder}" BorderThickness="1" Background="{StaticResource GridView_RowIndicatorCellBackground}"/>
                    </Border>
                    <Border x:Name="PART_HierarchyIndent" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,0" Grid.Column="2" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding HasHierarchy, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}" Width="25"/>
                    <telerik:DataCellsPresenter x:Name="PART_DataCellsPresenter" Grid.Column="3" telerik:StyleManager.Theme="{StaticResource Theme}"/>
                    <telerik:IndentPresenter x:Name="PART_IndentPresenter" Grid.Column="1" ItemTemplate="{StaticResource GridViewGroupFooterIndentCellDataTemplate}" IndentLevel="{TemplateBinding IndentLevel}" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" telerik:StyleManager.Theme="{StaticResource Theme}"/>
                </telerik:SelectiveScrollingGrid>
            </Border>
        </ControlTemplate>
        <LinearGradientBrush x:Key="GridView_FooterBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFB5B5B5"/>
            <GradientStop Color="#FFF0F0F0" Offset="0.5"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="ControlOuterBorder" Color="#FF848484"/>
        <Style x:Key="GridViewGroupFooterRowStyle1" TargetType="telerik:GridViewGroupFooterRow">
            <Setter Property="Template" Value="{StaticResource GridViewGroupFooterRowTemplate}"/>
            <Setter Property="Background" Value="{StaticResource GridView_FooterBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder}"/>
            <Setter Property="MinHeight" Value="25"/>
            <Setter Property="BorderThickness" Value="0,0,0,1"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        </Style>
    </UserControl.Resources>
      
    <Border x:Name="LayoutRoot" Background="YellowGreen" Padding="5">
  
        <telerik:RadGridView x:Name="dgrd" AutoGenerateColumns="False" ShowColumnFooters="True" ShowGroupFooters="True" Grouped="dgrd_Grouped" GroupFooterRowStyle="{StaticResource GridViewGroupFooterRowStyle1}">
              
            <telerik:RadGridView.Columns>
  
                <telerik:GridViewDataColumn Width="150" DataMemberBinding="{Binding col1, Mode=TwoWay}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:CountFunction Caption="Cnt(col1): " />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
  
                <telerik:GridViewDataColumn Width="150" DataMemberBinding="{Binding col2, Mode=TwoWay}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:CountFunction Caption="Cnt(col2): "  />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
  
                <telerik:GridViewDataColumn Width="150" DataMemberBinding="{Binding col3, Mode=TwoWay}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:AverageFunction Caption="Avg(col3): "  />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
  
                <telerik:GridViewDataColumn Width="150" DataMemberBinding="{Binding col4, Mode=TwoWay}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:MinFunction Caption="Min(col4): " />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
  
                <telerik:GridViewDataColumn Width="150" DataMemberBinding="{Binding col5, Mode=TwoWay}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:MaxFunction Caption="Max(col5): " />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
  
                <telerik:GridViewDataColumn Width="150" DataMemberBinding="{Binding col6, Mode=TwoWay}">
                </telerik:GridViewDataColumn>
  
                <telerik:GridViewDataColumn Width="150" DataMemberBinding="{Binding col7, Mode=TwoWay}">
                </telerik:GridViewDataColumn>
  
                <telerik:GridViewDataColumn Width="150" DataMemberBinding="{Binding col8, Mode=TwoWay}">
                </telerik:GridViewDataColumn>
  
            </telerik:RadGridView.Columns>
          
        </telerik:RadGridView>
  
    </Border>
  
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
  
namespace SilverlightApplication117
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            // Required to initialize variables
            InitializeComponent();
  
            System.Collections.ObjectModel.ObservableCollection<MyDataObject> TheList = new System.Collections.ObjectModel.ObservableCollection<MyDataObject>();
              
            for (int i = 0; i < 200; i++)
            {
                MyDataObject mdo = new MyDataObject()
                {
                    col3 = i,
                    col4 = i*i,
                    col5 = i+i,
                    col6 = (i+1)*(i+13),
                    col7 = -1*i,
                    col8 = i*i*i,
                };
                  
                switch (i % 10)
                {
                    case 0:
                        mdo.col1 = "a";
                        break;
                    case 1:
                        mdo.col1 = "b";
                        break;
                    case 2:
                        mdo.col1 = "c";
                        break;
                    case 3:
                        mdo.col1 = "d";
                        break;
                    case 4:
                        mdo.col1 = "e";
                        break;
                    case 5:
                        mdo.col1 = "f";
                        break;
                    case 6:
                        mdo.col1 = "g";
                        break;
                    case 7:
                        mdo.col1 = "h";
                        break;
                    case 8:
                        mdo.col1 = "i";
                        break;
                    case 9:
                        mdo.col1 = "j";
                        break;
                }
  
                switch (i % 3)
                {
                    case 0:
                        mdo.col2 = "x";
                        break;
                    case 1:
                        mdo.col2 = "y";
                        break;
                    case 2:
                        mdo.col2 = "z";
                        break;
                }
  
                TheList.Add(mdo);
            };
  
            this.dgrd.ItemsSource = TheList;
        }
  
        private void dgrd_Grouped(object sender, Telerik.Windows.Controls.GridViewGroupedEventArgs e)
        {
            this.dgrd.ExpandAllGroups();
        }
    }
  
  
    public class MyDataObject : INotifyPropertyChanged
    {
        private string _col1 = string.Empty;
        public string col1
        {
            get
            {
                return this._col1;
            }
            set
            {
                this._col1 = value;
                RaisePropertyChanged("col1");
            }
        }
  
        private string _col2 = string.Empty;
        public string col2
        {
            get
            {
                return this._col2;
            }
            set
            {
                this._col2 = value;
                RaisePropertyChanged("col2");
            }
        }
  
        private int _col3 = 0;
        public int col3
        {
            get
            {
                return this._col3;
            }
            set
            {
                this._col3 = value;
                RaisePropertyChanged("col3");
            }
        }
  
        private int _col4 = 0;
        public int col4
        {
            get
            {
                return this._col4;
            }
            set
            {
                this._col4 = value;
                RaisePropertyChanged("col4");
            }
        }
  
        private int _col5 = 0;
        public int col5
        {
            get
            {
                return this._col5;
            }
            set
            {
                this._col5 = value;
                RaisePropertyChanged("col5");
            }
        }
  
        private int _col6 = 0;
        public int col6
        {
            get
            {
                return this._col6;
            }
            set
            {
                this._col6 = value;
                RaisePropertyChanged("col6");
            }
        }
  
        private int _col7 = 0;
        public int col7
        {
            get
            {
                return this._col7;
            }
            set
            {
                this._col7 = value;
                RaisePropertyChanged("col7");
            }
        }
  
        private int _col8 = 0;
        public int col8
        {
            get
            {
                return this._col8;
            }
            set
            {
                this._col8 = value;
                RaisePropertyChanged("col8");
            }
        }
  
        public event PropertyChangedEventHandler PropertyChanged;
        public void RaisePropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler pChanged = PropertyChanged;
            if (pChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
          
          
    }
  
}


 

3 Answers, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 25 Nov 2010, 01:42 PM
Hi Rob,

We confirmed that this is a bug in our RadGridView. I have updated your Telerik points.

Please excuse us for any inconvenience caused.


Sincerely yours,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Rob
Top achievements
Rank 1
answered on 25 Nov 2010, 02:54 PM
Thanks Vanya.  Any ideas on when I might expect a fix or a way to get around this temporarily?
0
Vanya Pavlova
Telerik team
answered on 29 Nov 2010, 12:21 PM
Hello Rob,


For the time being I can offer you to set this style as global implicit style without specifying the Key attribute and it should work. The issue will be resolved in one of our next internal builds. Please try the attached project demonstrating this approach and once again excuse us for any inconvenience caused.


Kind regards,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
Rob
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Rob
Top achievements
Rank 1
Share this question
or