How to remove the "-" in the header?

3 posts, 0 answers
  1. Surendra
    Surendra avatar
    9 posts
    Member since:
    Apr 2011

    Posted 29 Dec 2011 Link to this post

    I have a requirement to display the header of the datetimepicker as "December 2011" instead of "December - 2011".

    I went through the style of  CalendarHeaderButton, in which i found the below 2 lines of code which is used to display the header in the control,





    TextBlock x:Name="BackgroundText" Foreground="{StaticResource HeaderTextBackground}" FontWeight="{StaticResource HeaderTextFontWeight}" HorizontalAlignment="Center" Margin="0 2 0 0" Text="{TemplateBinding Content}" VerticalAlignment="Center"/>









    <TextBlock x:Name="ForegroundText" Foreground="{StaticResource HeaderTextForeground}" FontWeight="{StaticResource HeaderTextFontWeight}" HorizontalAlignment="Center" Margin="0 1 0 1" Text="{TemplateBinding Content}" VerticalAlignment="Center"/>





    Since TemplateBinding is used here, i am not able to use a Converter to achieve this. Is there any alternate way to do this?

    N.Surendra Prasad

  2. Yana
    Yana avatar
    4604 posts

    Posted 30 Dec 2011 Link to this post

    Hello Surendra,

    You just need to set MonthViewHeaderFormat property of the Calender in DateTimePicker like this:

    <telerik:RadDateTimePicker InputMode="DateTimePicker">
            <Style TargetType="telerik:RadCalendar">
                <Setter Property="MonthViewHeaderFormat" Value="MMMM yyyy" />

    You don't need to edit the template.  Here you can find all the custom format strings that can be used.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Surendra
    Surendra avatar
    9 posts
    Member since:
    Apr 2011

    Posted 02 Jan 2012 Link to this post

    Hi Yana,

    Thank you so much.

    N.Surendra Prasad
Back to Top