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

[Solved] Issue with Font on RadGridView with Vista Theme

1 Answer 110 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.
Jeremy
Top achievements
Rank 1
Jeremy asked on 03 Jun 2009, 08:59 PM
I am using the Vista theme for my application and am overriding the font size on the RadGridView Control.  When I updated to the 2009_1_0526_hotfix binaries the override of the font size no longer works (foreground does not seem to work either).  When I turn off the Vista theme and use the default (no theme specified) the font overrides will then work for the column headings, however they still do not apply to the data rows as it did in the 2009_1_0413 binaries.  In the 2009_1_0423 binaries they font size in the RadGridView applied to both the column heading text and the data row text.

Is this a known issue?  If so is there a fix and/or workaround?

Thank you for any help or information.
- Jeremy

Vista Theme App.xaml.cs constructor
        public App() {  
            this.Startup += this.Application_Startup;  
            this.Exit += this.Application_Exit;  
            this.UnhandledException += this.Application_UnhandledException;  
            StyleManager.ApplicationTheme = ThemeManager.FromName("Vista");  
            InitializeComponent();  
        } 

Default Theme App.xaml.cs constructor
        public App() {  
            this.Startup += this.Application_Startup;  
            this.Exit += this.Application_Exit;  
            this.UnhandledException += this.Application_UnhandledException;  
            InitializeComponent();  
        } 

ExampleGrid.xaml
<UserControl x:Class="WindowExample.ExampleGrid" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
    xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"   
    xmlns:GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"   
    > 
    <Grid x:Name="LayoutRoot" > 
        <Controls:RadGridView Name="sampleRadGridView" 
                ColumnsWidthMode="Fill" 
                
AutoGenerateColumns="False" 
                
ShowGroupPanel="True" 
                
FontSize="8">  
            <Controls:RadGridView.Columns> 
                <Controls:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding ContactName}">  
                    <Controls:GridViewDataColumn.CellStyle> 
                        <Style TargetType="GridView:GridViewCell">  
                            <Setter Property="Template">  
                                <Setter.Value> 
                                <ControlTemplate> 
                                    <Button x:Name="ActionButton" Content="Some Action" Click="ActionButton_Click"</Button> 
                                </ControlTemplate> 
                                </Setter.Value> 
                                </Setter> 
                        </Style> 
                    </Controls:GridViewDataColumn.CellStyle> 
                </Controls:GridViewDataColumn> 
                <Controls:GridViewDataColumn HeaderText="CustomerID" IsReadOnly="True" UniqueName="CustomerID"    /> 
                <Controls:GridViewDataColumn HeaderText="CompanyName" IsReadOnly="True" UniqueName="CompanyName" /> 
                <Controls:GridViewDataColumn HeaderText="Country" UniqueName="Country" /> 
                <Controls:GridViewDataColumn HeaderText="City" UniqueName="City" /> 
                <Controls:GridViewDataColumn HeaderText="ContactName" UniqueName="ContactName" /> 
            </Controls:RadGridView.Columns> 
        </Controls:RadGridView> 
    </Grid> 
</UserControl> 
 

1 Answer, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 05 Jun 2009, 09:19 AM
Hi Jeremy,

I have tested your sample and indeed the FontSize is not being applied to the GridView cells. There are some changes in the templates which set the size of the font in different elements to enable better customization of the grid.

One workaround is to use cell style and apply it to the columns.
<UserControl.Resources> 
    <Style x:Key="GridViewCellStyle" TargetType="grid:GridViewCell">  
        <Setter Property="FontSize" Value="8" /> 
    </Style> 
</UserControl.Resources> 
The downside of this approach is that it will also apply the Office_Black template of the cell and you will have to restyle that one too.

That being said I will look into the changes we have made and try to revert that feature back to the state in 2009_1_0413 binaries without compromising the stylability of the grid.

I apologize for any inconvenience this might cause.

Regards,
Kalin Milanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Share this question
or