Change the font of the calendar within RadDatePicker

5 posts, 1 answers
  1. Dan
    Dan avatar
    8 posts
    Member since:
    Jun 2009

    Posted 30 Jun 2009 Link to this post

    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?
  2. Answer
    Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 01 Jul 2009 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dan
    Dan avatar
    8 posts
    Member since:
    Jun 2009

    Posted 01 Jul 2009 Link to this post

    I knew it'd be something simple, thanks very much!
  5. Luke Raynor
    Luke Raynor avatar
    2 posts
    Member since:
    Apr 2010

    Posted 12 Apr 2010 Link to this post

    How can i apply this property at runtime at the server side based on a database setting?
  6. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 16 Apr 2010 Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready