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

is there a way?

1 Answer 80 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 10 Jun 2009, 09:59 AM
Hi Is there a way to diable all the days in a month on the calendar control then re-enable certain days depending on if we needed them to be re-enabled

Many thanks

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Jun 2009, 07:01 AM
Hi Kevin,

Instead of disabling all the days initially and then re-enabling certain days depending on the condition, my suggestion would be to disable all the days of the month depending on the condition.

CS:
 
 protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e) 
    { 
        if (e.Day.Date.Month.ToString() == "6"
        { 
            DateTime SpecialDate = Convert.ToDateTime("06/11/2009"); 
            if (e.Day.Date.Date != SpecialDate) 
            { 
 
                // disable the selection for the specific day 
                RadCalendarDay calendarDay = new RadCalendarDay(); 
                calendarDay.Date = e.Day.Date; 
                calendarDay.IsSelectable = false
                RadCalendar1.SpecialDays.Add(calendarDay); 
            } 
 
        } 
      
 
    } 


Thanks
Shinu
Tags
Calendar
Asked by
Kevin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or