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

DayRender IsSelectable not working

1 Answer 86 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 12 Feb 2013, 04:59 PM
I am having some issue with the IsSelectable field on a day. I am setting e.Day.IsSelected = false in the DayRender server event handler but then when a date is selected using the client side DateSelecting event, it always says true, even in the most simple example.  I found this thread from 1/2009 where a Telerik representative said the issue had been elevated and would be corrected quickly.  Am I doing something wrong, or is this still an issue with the Calendar?  Is there a workaround available?

C#:
protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
{
        e.Day.IsSelectable = false;
}

Javascript:
function Calendar_OnDateSelecting(sender, args) {
    args.set_cancel(true);
    alert(args.get_renderDay().get_isSelectable());
}

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 15 Feb 2013, 01:41 PM
Hi Matt,

Please try the following approach:
protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
{
    RadCalendarDay day = new RadCalendarDay();
    day.Date = e.Day.Date;
    day.IsSelectable = false;
 
    RadCalendar1.SpecialDays.Add(day);
}

That should do the trick. Please give it a try and let me know if it works for you.

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Calendar
Asked by
Matt
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or