New to Telerik UI for WPF? Download free 30-day trial

Limit selection when DateSelectionMode="Month"


Product RadDateTimePicker for WPF


How to limit selection when the DateSelectionMode property is Month.


Create a custom StyleSelector and disable the months by setting the IsEnabled property of the CalendarButtonContent. After that, set the StyleSelector to the MonthButtonStyleSelector property of the RadDateTimePicker.

public class MonthSelector : StyleSelector 
    public override Style SelectStyle(object item, DependencyObject container) 
        CalendarButtonContent content = item as CalendarButtonContent; 
        if (content != null) 
            var monthsToEnable = new List<string>() { "Mar", "Jun", "Sep", "Dec" }; 
            if (!monthsToEnable.Contains(content.Text)) 
                content.IsEnabled = false; 
        return base.SelectStyle(item, container); 

        <local:MonthSelector x:Key="monthSelector"/> 
    <telerik:RadCalendar DateSelectionMode="Month" 
                         MonthButtonStyleSelector="{StaticResource monthSelector}"/> 
In this article