Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > DatePicker > How to remove the "-" in the header?

Not answered How to remove the "-" in the header?

Feed from this thread
  • Surendra avatar

    Posted on Dec 29, 2011 (permalink)

    Hi,
    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?

    Regards
    N.Surendra Prasad

    Reply

  • Yana Yana admin's avatar

    Posted on Dec 30, 2011 (permalink)

    Hello Surendra,

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

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

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

    Kind regards,
    Yana
    the Telerik team

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

    Reply

  • Surendra avatar

    Posted on Jan 2, 2012 (permalink)

    Hi Yana,

    Thank you so much.

    Regards
    N.Surendra Prasad

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > DatePicker > How to remove the "-" in the header?
Related resources for "How to remove the "-" in the header?"

Silverlight DatePicker Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]