Hi,
I need to disable the dates outside the current month of the current view.
For example February, then I want to disable 26-31 of January and 1-8 of Mars.
I'm trying with the dayrender method with no success.
(the red background is set so the if-statement is working)
With this code I can still click on all dates! :(
Is it because I have AutoPostBack=true?
I need to disable the dates outside the current month of the current view.
For example February, then I want to disable 26-31 of January and 1-8 of Mars.
I'm trying with the dayrender method with no success.
protected void radCalendar_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e) |
{ |
if (e.Day.Date < _calendarFirstDateOfMonth || e.Day.Date > _calendarLastDateOfMonth) |
{ |
e.Cell.Style.Add(HtmlTextWriterStyle.Cursor, "default"); |
e.Cell.Style.Add(HtmlTextWriterStyle.BackgroundColor, "#ff0000"); |
e.Day.IsSelectable = false; |
e.Day.IsDisabled = true; |
} |
else |
{ |
if (SelectedEvents != null) |
{ |
foreach (Swh.Ih7.Entities.Event ev in SelectedEvents) |
{ |
if (e.Day.Date >= ev.StartDate.Date && e.Day.Date <= ev.EndDate.Date) |
{ |
e.Cell.Style.Add(HtmlTextWriterStyle.FontWeight, "700"); |
} |
} |
} |
} |
} |
With this code I can still click on all dates! :(
Is it because I have AutoPostBack=true?