This is a migrated thread and some comments may be shown as answers.

Multiview Calendar - Hide some months?

1 Answer 45 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 06 Apr 2012, 03:26 AM
I have a Multiview calendar which is set by default to show 1 year, in 4 columns and 3 rows.

I have 2 other DatePickers on the page that let the user pick a start and end date.

Based on the range selection in the 2 datepickers, I would like to hide unused months in the Multiview calendar.  For instance, I show 12 months by default in Multiview, but if you select a range of April to August, then I would like to show the first row of 4, but then only 1 month calendar in row 2 - effectively hiding the last 7 months.  All of this to be done dynamically on the server-side.


I can't seem to find a way to do this.  Any one?

1 Answer, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 1
answered on 06 Apr 2012, 03:54 AM
I think I figured it out myself with some trial and error:

<telerik:RadCalendar ID="RadCalendar1" runat="server" AutoPostBack="true" MultiViewColumns="4" MultiViewRows="3" EnableMultiSelect="true" />



RadCalendar1.FocusedDate = StartDate
RadCalendar1.RangeMinDate = StartDate
RadCalendar1.RangeMaxDate = EndDate 
 
For Each m In RadCalendar1.CalendarView.ChildViews
   If m.MonthStartDate > EndDate Then
      m.IsHidden = True
   End If
Next
Tags
Calendar
Asked by
Dan
Top achievements
Rank 1
Answers by
Dan
Top achievements
Rank 1
Share this question
or