Edit this page

How to hide week numbers

This article shows you how to hide week numbers in RadDateTimePicker control. In the previous versions of RadDatePicker control there was an AreWeekNumbersVisible property which indicates whether the week numbers are visible or not. This property is Obsolete in the current version of RadDateTimePicker(Q2 2010) and it will be removed in the future releases. From now on if you want to disable the week numbers in RadDateTimePicker (and in RadDatePicker as well) I would suggest you to use the CalendarStyle property. This style affects the style of the RadCalendar, placed inside the RadDateTimePicker. Using this property is very useful, because it allows you to set more additional properties to the calendar. So, here are the steps to create a CalendarStyle and disable week numbers:

  • First, create a Style for the RadCalendar:

<UserControl.Resources>
    <Style x:Key="calendarStyle" TargetType="telerik:RadCalendar">
        <!--....-->
    </Style>
</UserControl.Resources>
  • Then, add a Setter for AreWeekNumbersProperty property and set the Value to False

<UserControl.Resources>
    <Style x:Key="calendarStyle" TargetType="telerik:RadCalendar">
        <Setter Property="AreWeekNumbersVisible" Value="False" />
    </Style>
</UserControl.Resources>
  • The final step is to create a RadDateTimePicker control and set CalendarStyle to the Style that you created. Please, pay attention that if the InputMode is set to TimePicker, the CalendarStyle will take no effect on the control.

<telerik:RadDateTimePicker Width="100"                            
                   InputMode="DatePicker"                            
                   CalendarStyle="{StaticResource calendarStyle}"                            
                   VerticalAlignment="Center"/>

Here is the result:

That's all! We created a simple RadDateTimePicker control and hid the week numbers. You could use the same method to set whatever property you want to customize the RadCalendar in the RadDateTimePicker control.

Was this article helpful? Yes No

Give article feedback

Tell us how we can improve this article

Dummy