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

Cannot specify FontWeight

2 Answers 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 2
Steve asked on 26 May 2010, 08:56 PM
If I specify a FontWeight="ExtraBold", the font is displayed as "Normal" in both RadGrid and RadCalendar, yet in a simple TextBox, the weight is applied as I expect.  FontFamily and FontStyle work fine...but not FontWeight.  I'm using Silverlight controls version 422, VS2010, and Silverlight 4.

<UserControl   
    xmlns:input="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"    
    xmlns:grid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="400" x:Class="FontWeight.MainPage" > 
 
    <Grid x:Name="LayoutRoot" Background="White">  
        <Grid.RowDefinitions> 
            <RowDefinition Height="Auto" ></RowDefinition>  
            <RowDefinition Height="Auto" ></RowDefinition>  
            <RowDefinition Height="Auto" ></RowDefinition>  
            <RowDefinition Height="Auto" ></RowDefinition>  
            <RowDefinition Height="Auto" ></RowDefinition>  
        </Grid.RowDefinitions> 
        <grid:RadGridView Grid.Row="0" x:Name="dgMain" FontFamily="Verdana" FontWeight="ExtraBold" FontStyle="Italic" /> 
        <input:RadCalendar Grid.Row="1" x:Name="rCalendar" FontFamily="Verdana" FontWeight="Normal" FontStyle="Normal" /> 
        <TextBox Grid.Row="2" FontFamily="Verdana" FontWeight="ExtraBold" FontStyle="Italic" Text="Hello World" /> 
        <TextBox Grid.Row="3" FontFamily="Verdana" FontWeight="Normal" FontStyle="Normal" Text="Hello World" /> 
    </Grid> 
</UserControl> 
Here's my code-behind:
        public MainPage()  
        {  
            InitializeComponent();  
            LoadGrid();  
        }  
 
        private void LoadGrid()  
        {  
            List<Class1> rows = new List<Class1>();  
            Class1 row = new Class1();  
            row.description = "Hello World";  
            rows.Add(row);  
            dgMain.ItemsSource = rows;  
        }  
 
And associated class:
namespace FontWeight  
{  
    public class Class1  
    {  
        public string description { getset; }  
    }  
}  
 
See attached file for the output.  Why doesn't FontWeight work with the Rad controls?

2 Answers, 1 is accepted

Sort by
0
Accepted
Kalin Milanov
Telerik team
answered on 31 May 2010, 10:55 AM
Hello Steve Dentel,

To apply FontWeight to the cells you will need to define style for the grid's cells. 
Attached I am sending you a sample which does just that. I hope you will find it useful.

All the best,
Kalin Milanov
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
Steve
Top achievements
Rank 2
answered on 09 Jun 2010, 04:49 PM
Thank you Kalin...this works perfectly.
Tags
GridView
Asked by
Steve
Top achievements
Rank 2
Answers by
Kalin Milanov
Telerik team
Steve
Top achievements
Rank 2
Share this question
or