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

Change the font of the calendar within RadDatePicker

4 Answers 229 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 30 Jun 2009, 08:38 AM
I've got a RadDatePicker, and I'd like to be able to set the font of the days within the calendar, but can't find an obvious way of doing so.

Here's some code I tried:

        <telerik:RadDatePicker Grid.Row="4" Grid.Column="1" Name="DatePlanned"  
                               SelectedDate="{Binding SelectedDatePlanned, Mode=TwoWay}" > 
            <telerik:RadDatePicker.MonthViewStyle> 
                <Style> 
                    <Setter Property="Control.FontSize" Value="16" /> 
                </Style> 
            </telerik:RadDatePicker.MonthViewStyle> 
        </telerik:RadDatePicker> 

How can I accomplish this?

4 Answers, 1 is accepted

Sort by
0
Accepted
Kaloyan
Telerik team
answered on 01 Jul 2009, 09:16 AM
Hello Dan,

You can set the font of the days within the calendar using this code snippet:
 <telerik:RadDatePicker Width="200" Height="20"
            <telerik:RadDatePicker.DayTemplate> 
                <DataTemplate> 
                    <TextBlock Text="{Binding Text}" FontSize="16" /> 
                </DataTemplate> 
            </telerik:RadDatePicker.DayTemplate> 
        </telerik:RadDatePicker> 



Kind regards,
Kaloyan
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.
0
Dan
Top achievements
Rank 1
answered on 01 Jul 2009, 01:32 PM
I knew it'd be something simple, thanks very much!
0
Luke Raynor
Top achievements
Rank 1
answered on 13 Apr 2010, 03:06 AM
How can i apply this property at runtime at the server side based on a database setting?
0
Kaloyan
Telerik team
answered on 16 Apr 2010, 08:40 AM
Hi Luke Raynor,

There are tow options. A better approach is to use the DayTemplateSelector property of the control, that will get you the write DayTemplate depending on your custom logic.  The second alternative is to defined the template in code behind as a string and load it using the XamlRead.Parse method.

Sincerely yours,
Kaloyan
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.
Tags
DatePicker
Asked by
Dan
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Dan
Top achievements
Rank 1
Luke Raynor
Top achievements
Rank 1
Share this question
or