How to disable some days of moth ???

2 posts, 0 answers
  1. Carlos Marchi
    Carlos Marchi avatar
    21 posts
    Member since:
    Sep 2009

    Posted 11 Nov 2009 Link to this post

    Hi Everybody,

    I've been finding a solution to this problem, but I havent solve this problem. I'm going to try explain this problem...

    There is a aspx page where there is a calender control. The user select any dates, for example, the user selected theses dates: 9/11/2009, 12/12/2009 and 1/20/2009. Then the user clicks on next button, then this button redirects for another page. This new page there is another calender control, this calender control there are dates of period of time, like min: 1/1/2009 max: 1/1/2010.

    But this calendar shows just dates that the user didnt select las page. So, that three date that the user selected above wont be to show them in this calendar.

    Has Somebody ever had this problem? Can Anybody help me, please?

    Thank you for attention,

    Carlos
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Nov 2009 Link to this post

    Hi Carlos,

    I tried following code in order to achieve same scenario. Access the calendar control in the previous page and get the selected dates, then add these RadCalendar days to SpecialDays collection by setting the properties IsDisabled to false.

    In the first page:
     
     <telerik:RadCalendar ID="RadCalendar1" Runat="server"
        </telerik:RadCalendar> 
        <asp:Button ID="Button1" runat="server" Click" Text="Next" PostBackUrl="~/Calendar/Redirect.aspx" /> 

    And code in the second page:
     
        protected void Page_Load(object sender, EventArgs e) 
        { 
            RadCalendar cal = (RadCalendar)PreviousPage.FindControl("RadCalendar1"); 
            RadCalendarDay day = new RadCalendarDay(); 
            day.Date = cal.SelectedDate.Date; 
            day.IsDisabled = true
            day.IsSelectable = false
            RadCalendar2.SpecialDays.Add(day); // RadCalendar2 placed in second page
        } 
    [Alter the logic to disable multiple dates]

    Regards,
    Shinu.
Back to Top