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

How to disable some days of moth ???

1 Answer 112 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Carlos Marchi
Top achievements
Rank 1
Carlos Marchi asked on 11 Nov 2009, 06:55 PM
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

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Nov 2009, 06:01 AM
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.
Tags
Calendar
Asked by
Carlos Marchi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or