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

How to configure FontSize on GridViewFooterCell and GridViewGroupFooterCell

1 Answer 71 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Carles
Top achievements
Rank 1
Carles asked on 07 Feb 2014, 01:42 PM
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">
.......






1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 12 Feb 2014, 02:27 PM
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).

Tags
GridView
Asked by
Carles
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or