How to configure FontSize on GridViewFooterCell and GridViewGroupFooterCell

2 posts, 0 answers
  1. Carles
    Carles avatar
    1 posts
    Member since:
    Jul 2012

    Posted 07 Feb 2014 Link to this post

    Hi Team,

    I would like to configure the FontSize on the both elements  GridViewFooterCell and GridViewGroupFooterCell.
    I defined a style for each in the UserControl.Resources. All the properties work well except the FontStyle which reminds unchanged.
    Could you help me. Thanks.

    Regards

    Eric.

    <UserControl.Resources>
    <System:String x:Key="FormatNbMoyenHeader">{0:N0} (M)</System:String>
    <System:String x:Key="FormatNbTotalHeader">{0:N0} (T)</System:String>
    <Style TargetType="telerik:GridViewGroupFooterRow">
    <Setter Property="Background" Value="{StaticResource Yellow}"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    </Style>
    <Style  TargetType="telerik:GroupHeaderRow">
    <Setter Property="Background" Value="GhostWhite"/>
    <Setter Property="ShowGroupHeaderColumnAggregates" Value="True" />
    <Setter Property="ShowHeaderAggregates" Value="False"/>
    <Setter Property="Padding" Value="5,1"/>
    <Setter Property="FontSize" Value="16"/>
    <Setter Property="FontWeight" Value="normal"/>
    </Style>
    <Style TargetType="telerik:GridViewFooterCell">
    <Setter Property="Background" Value="Black" />
    <Setter Property="Foreground" Value="White" />
    <Setter Property="HorizontalContentAlignment" Value="Right"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="TextAlignment" Value="Right"/>
    <Setter Property="Padding" Value="5,1"/>
    <Setter Property="FontSize" Value="20"/>
    </Style>
    <Style  TargetType="telerik:GridViewGroupFooterCell">
    <Setter Property="HorizontalContentAlignment" Value="Right"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Padding" Value="5,1"/>
    <Setter Property="FontSize" Value="16"/>
    <Setter Property="FontWeight" Value="normal"/>
    </Style>
    <DataTemplate x:Key="NbTrsPerfTemplateOK">
    <Border Background="Green">
    <TextBlock Foreground="White"
      Text="{Binding UnitPrice, StringFormat=c}" />
    </Border>
    </DataTemplate>
    <DataTemplate x:Key="NbTrsPerfTemplateKO">
    <Border Background="Red">
    <TextBlock Foreground="White"
      Text="{Binding UnitPrice, StringFormat=c}" />
    </Border>
    </DataTemplate>
        </UserControl.Resources>

        <Grid x:Name="LayoutRoot" Background="White">
    <Grid.ColumnDefinitions>
    <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="20"/>
    <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!-- DataGrid affichage des résultats -->
    <telerik:RadGridView 
    Grid.Row="4"
    Name="RadGridViewAnalyseDetailleeProduction"
    ScrollMode="RealTime" 
    AutoGenerateColumns="False" 
    ItemsSource="{Binding CollectionCalagesStatsProdPourAnalyse}" 
    GroupRenderMode="Flat" 
    ShowColumnFooters="True" 
    GridLinesVisibility="Vertical"
    IsReadOnly="True"
    FontSize="12">
    .......






  2. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 12 Feb 2014 Link to this post

    Hello Carles,

    You can try to define the GridViewDataColumn's Footer like so:
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" >
                        <telerik:GridViewDataColumn.AggregateFunctions>
                            <telerik:CountFunction Caption="Count: " />
                        </telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:GridViewDataColumn.Footer>
                            <StackPanel Orientation="Vertical"
                                        Margin="0,10">
                                
                                <telerik:AggregateResultsList ItemsSource="{Binding}"
                                                              VerticalAlignment="Center"
                                                              Grid.Column="4">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal"
                                                        VerticalAlignment="Center">
                                                <TextBlock VerticalAlignment="Center"
                                                           Text="{Binding Caption}" />
                                                <TextBlock VerticalAlignment="Center"
                                                           Text="{Binding FormattedValue}" />
                                            </StackPanel>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Vertical" />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                </telerik:AggregateResultsList>
                            </StackPanel>
                        </telerik:GridViewDataColumn.Footer>
                    </telerik:GridViewDataColumn>

    You can check our online demo for a reference. Please give it a try and let me know how it works for you.


    Regards,
    Yoan
    Telerik

    Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

  3. DevCraft banner
Back to Top