RadDateTimePicker Change Calendar to Month View

1.8k Views Asked by At

is there a way for me to format the raddatetimepicker to have a month and year view on selection view?..

something like this..

enter image description here

what I have tried so far is this:

dateStartDate.Value = DateTime.Now;
dateStartDate.Format = DateTimePickerFormat.Custom;
dateStartDate.CustomFormat = "MMMM - yyyy";
dateStartDate.ShowUpDown = true;

enter image description here

but it doesn't show the view anymore instead gives me an up and down button to change the month....

I am Using C# as my language and telerik..... and this is a windows form...

1

There are 1 best solutions below

5
On

Not sure if you have read this or not, but I think it'd certainly help point you to the right direction.

Customize RadCalendar Programmatically

Essentially, you will need to get a reference of RadCalendar from your RadDateTimePicker control, and from there, you can start customising its calendar view based on your own need.

RadDateTimePickerCalendar calendarBehavior = this.dateStartDate.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar;
RadCalendar calendar = calendarBehavior.Calendar as RadCalendar;
RadCalendarElement calendarElement = calendar.CalendarElement as RadCalendarElement;

Update

In your case, I think you will be looking at the ZoomLevel of RadClaendar. Something like this

calendar.HeaderNavigationMode = HeaderNavigationMode.Zoom;
calendar.ZoomLevel = ZoomLevel.Months;

Customize Zoom Navigation