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

Is it possible to dock column footer at the top of the grid ?

7 Answers 290 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joachim
Top achievements
Rank 1
Joachim asked on 12 Oct 2010, 09:03 AM
Hello Telerik Team !

I'm using your last version of Telerik Rad Controls for Silverlight an i was wondering if it was possible to dock the column footers at the top of the grid instead of the bottom ?
What i want to do is to use aggregate functions within this column footer to show the sum or average of all the cell value in a column.

Thank you for your help !

Joachim.

7 Answers, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 13 Oct 2010, 02:52 PM
Hi Joachim,

In order to be able to perform and  display different calculations in a GridViewColumns, I recommend you to see the following Totals demo. Considering your second question I have prepared an example for you that demonstrates how to show GridViewFooterRow under the GridViewHeaderRow through editing the template of the RadGridView.

Please see the attached and if you need any additional information please let me know.

Best wishes,
Vanya Pavlova
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
Joachim
Top achievements
Rank 1
answered on 13 Oct 2010, 03:16 PM
Yes, It's exactly what i need !
Thank you Vanya for your usefull help.

Why don't you share all your samples projects in a repository on your web site ? (in the resource section for example)
I think it might be very usefull and free your time ;)

Thanks again Vanya.
0
Alexandre
Top achievements
Rank 1
answered on 26 Jan 2011, 10:59 PM
Hi,

This is exactly what I need but I would like the keep the footer row in the header even when the group is expended, do you think that it would be possible ?

Regards,
Alex
0
Vanya Pavlova
Telerik team
answered on 27 Jan 2011, 05:37 PM
Hi Joachim,

 
With the current implementation of GridViewGroupRow such an attempt may result in an unexpected behavior and I strongly advocate to keep its default appearance.

Regards,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Gopala
Top achievements
Rank 1
answered on 03 Jul 2012, 11:08 PM
Hi,

I also need same thing. If my scroll bars has default styles it is working good but if I use my styles then footer row is over lapping my vertical scroll bar as shown in attachment. Please help me out.
0
Gopala
Top achievements
Rank 1
answered on 05 Jul 2012, 06:40 PM
I was able to solve this like below

<ControlTemplate TargetType="telerik:RadGridView">
          <Border x:Name="PART_MasterGridContainer"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}"
                  Padding="{TemplateBinding Padding}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="GridViewActivity">
                <VisualState x:Name="Idle">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="PART_GridViewLoadingIndicator">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                              Value="Collapsed" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Busy">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="PART_GridViewLoadingIndicator">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                              Value="Visible" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ColumnHeadersVisibility">
                <VisualState x:Name="ColumnHeadersVisible">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="PART_HeaderRow">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                              Value="Visible" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ColumnHeadersCollapsed">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="PART_HeaderRow">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                              Value="Collapsed" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ColumnFootersVisibility">
                <VisualState x:Name="ColumnFootersVisible">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="PART_FooterRow">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                              Value="Visible" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ColumnFootersCollapsed">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="PART_FooterRow">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                              Value="Collapsed" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="GroupPanelVisibility">
                <VisualState x:Name="GroupPanelVisible">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="PART_GroupPanel">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                              Value="Visible" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="GroupPanelCollapsed">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="PART_GroupPanel">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                              Value="Collapsed" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="InsertRowVisibility">
                <VisualState x:Name="InsertRowVisible">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="PART_AddNewRow">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                              Value="Visible" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="InsertRowCollapsed">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                   Storyboard.TargetName="PART_AddNewRow">
                      <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                              Value="Collapsed" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="HierrarchyBackground"
                  Background="{TemplateBinding Background}">
              <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition x:Name="ScrollBarColumn"
                                  MinWidth="0"
                                  Width="0" />
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition x:Name="PART_AttachedBehaviorRow"
                               Height="Auto" />
                <RowDefinition />
                <RowDefinition x:Name="ScrollBarRow"
                               Height="0"
                               MinHeight="0" />
                <RowDefinition Height="Auto" />
              </Grid.RowDefinitions>
              <telerik:GridViewGroupPanel x:Name="PART_GroupPanel"
                                          BorderBrush="{StaticResource GridView_GroupPanelOuterBorder}"
                                          Background="{TemplateBinding GroupPanelBackground}"
                                          Grid.ColumnSpan="2"
                                          Foreground="{TemplateBinding GroupPanelForeground}"
                                          Grid.Row="0"
                                          telerik:StyleManager.Theme="{StaticResource Theme}" />
 
              <telerik:GridViewScrollViewer x:Name="PART_ItemsScrollViewer"
                                            Background="Transparent"
                                            CanContentScroll="True"
                                            Grid.ColumnSpan="2"
                                            Grid.Row="2"
                                            Grid.RowSpan="2"
                                            Style="{StaticResource GridViewScrollViewerStyle1}">
 
                <telerik:GridViewScrollViewer.FooterRow>
                  <telerik:GridViewFooterRow x:Name="PART_FooterRow"
                                             IndentLevel="{TemplateBinding GroupCount}"
                                             telerik:StyleManager.Theme="{StaticResource Theme}"/>
                </telerik:GridViewScrollViewer.FooterRow>
                
                <telerik:GridViewScrollViewer.HeaderRow>
                  <telerik:GridViewHeaderRow x:Name="PART_HeaderRow"
                                             IndentLevel="{TemplateBinding GroupCount}"
                                             telerik:StyleManager.Theme="{StaticResource Theme}" />
                </telerik:GridViewScrollViewer.HeaderRow>
                <telerik:GridViewScrollViewer.NewRow>
                  <telerik:GridViewNewRow x:Name="PART_AddNewRow"
                                          IndentLevel="{TemplateBinding GroupCount}"
                                          telerik:StyleManager.Theme="{StaticResource Theme}"
                                          Visibility="Collapsed" />
                </telerik:GridViewScrollViewer.NewRow>
                
                <telerik:GridViewVirtualizingPanel x:Name="PART_GridViewVirtualizingPanel"/>
              </telerik:GridViewScrollViewer>
 
 
              <telerik:ScrollPositionIndicator x:Name="PART_ScrollPositionIndicator"
                                               Grid.ColumnSpan="2"
                                               ContentTemplate="{TemplateBinding ScrollPositionIndicatorTemplate}"
                                               HorizontalAlignment="Right"
                                               IsHitTestVisible="False"
                                               Margin="0,0,28,0"
                                               Grid.Row="2"
                                               telerik:StyleManager.Theme="{StaticResource Theme}"
                                               Visibility="{Binding IsScrolling, Converter={StaticResource BooleanToVisibilityConverter}, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
              <Border x:Name="PART_FrozenColumnsPreview"
                      Background="#33000000"
                      HorizontalAlignment="Left"
                      Grid.Row="1"
                      Grid.RowSpan="4"
                      Visibility="Collapsed"
                      VerticalAlignment="Stretch"
                      Width="6" />
              <telerik:GridViewLoadingIndicator x:Name="PART_GridViewLoadingIndicator"
                                                Grid.ColumnSpan="2"
                                                Grid.RowSpan="4"
                                                telerik:StyleManager.Theme="{StaticResource Theme}"
                                                Visibility="Collapsed" />
            </Grid>
          </Border>
        </ControlTemplate>


void grid_Loaded(object sender, RoutedEventArgs e)
    {
      GridViewScrollViewer scroller = gridCusip.ChildrenOfType<GridViewScrollViewer>().Where(b => b.Name == "PART_ItemsScrollViewer").FirstOrDefault();
      if (scroller != null)
      {
        scroller.FooterRow.RowIndicatorVisibility = Visibility.Visible;
        Grid.SetRow(scroller.FooterRow, 1);
      }
     
    }
0
Eric
Top achievements
Rank 1
answered on 16 Feb 2013, 04:07 PM
Is there anyway to do this with the Windows8/Metro skin. i have issues with the toggle button not showing, or being un-clickable. Also is it possible to hide the expand button if there is only one item in each group?

Many Thanks.
Tags
GridView
Asked by
Joachim
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Joachim
Top achievements
Rank 1
Alexandre
Top achievements
Rank 1
Gopala
Top achievements
Rank 1
Eric
Top achievements
Rank 1
Share this question
or