This is a migrated thread and some comments may be shown as answers.
Footer Row can't chagne the FontSize in Style
3 Answers 14 Views
This is a migrated thread and some comments may be shown as answers.
danparker276
Top achievements
Rank 2
danparker276 asked on 10 Jul 2013, 10:38 PM
I tried both footer row styles and footer cells styles, but I can't seem to change the font size of the footer.  I don't really want to create my own footer template for this.
I tried this:
<Style x:Key="Bold10CellStyle" TargetType="telerik:GridViewFooterCell"  >
    <Setter Property="FontSize" Value="10" />
    <Setter Property="FontWeight" Value="Bold" />
</Style>
 
<Style x:Key="SmallBoldFooter" TargetType="telerik:GridViewFooterRow">
    <Setter Property="FontSize" Value="10" />
    <Setter Property="FontWeight" Value="Bold" />
</Style>

Both of these would make my footer bold, but it wouldn't change the fontsize

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 11 Jul 2013, 10:14 PM
Hello Dan,


In general with both styles you can set the FontSize property of a single GridViewFooterCell or to all GridViewFooterCells through defining a style targeted at GridViewFooterRow.
Would it be possible to try to isolate the problem in a small runnable project and send it back to us as an attachment in a new support thread?





Regards,
Vanya Pavlova
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Heiko
Top achievements
Rank 1
answered on 27 Dec 2020, 12:10 PM

Hi all,

I know this is many years old but today I ran into the same problem. I have created two styles:

<Style x:Key="SmallThinFooter" TargetType="telerik:GridViewFooterRow" BasedOn="{StaticResource GridViewFooterRowStyle}">
    <Setter Property="FontSize" Value="6"/>
    <Setter Property="FontWeight" Value="Thin" />
</Style>
 
<Style x:Key="SmallThinGroupFooter" TargetType="telerik:GridViewGroupFooterRow" BasedOn="{StaticResource GridViewGroupFooterRowStyle}">
    <Setter Property="FontSize" Value="6"/>
    <Setter Property="FontWeight" Value="Thin" />
</Style>

Then set these styles to my RadGridView:

<telerik:RadGridView x:Name="grdSalesOrderDetails" Grid.Row="1"
                     Style="{StaticResource ResourceKey=SalesOrderDetailGrid}"
                     FooterRowStyle="{StaticResource ResourceKey=SmallThinFooter}"
                     GroupFooterRowStyle="{StaticResource ResourceKey=SmallThinGroupFooter}"
                     ItemsSource="{Binding SalesOrderDetailList}"... >

The result see attached screenshot, the FontWeight is "Thin", but FontSize is not changed.

Regards
Heiko

0
Martin Ivanov
Telerik team
answered on 30 Dec 2020, 11:10 AM

Hello Heiko,

This reproduces only in the Telerik themes that support palettes. In your case this is the Fluent theme or at least it seems so from the picture. In this case, the FontSize is fetched and assigned to the RadGridView elements using one of the palette property. This setting has a higher priority then a Style Setter which is why your code snippet doesn't work. 

To achieve your requirement, you can set the FontSize property of the palette. However, this will replace the size for all Telerik controls that use the palette property.

FluentPalette.Palette.FontSize = 6;  

If you want to set the font size only to the footer elements, you can use the CellLoaded event where you can set the FontSize of the GridViewFooterCell elements in code. This will override the palette setting because it has a higher priority.

private void RadGridView_CellLoaded(object sender, CellEventArgs e)
{
	if (e.Cell is GridViewFooterCell)
	{
		e.Cell.FontSize = 6;
	}
}

I hope this helps.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Asked by
danparker276
Top achievements
Rank 2
Answers by
Vanya Pavlova
Telerik team
Heiko
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or