Multiview Calendar - Hide some months?

2 posts, 0 answers
  1. Dan
    Dan avatar
    124 posts
    Member since:
    Feb 2011

    Posted 05 Apr 2012 Link to this post

    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?

  2. Dan
    Dan avatar
    124 posts
    Member since:
    Feb 2011

    Posted 05 Apr 2012 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top