DayRender IsSelectable not working

2 posts, 0 answers
  1. Matt
    Matt avatar
    2 posts
    Member since:
    Feb 2013

    Posted 12 Feb 2013 Link to this post

    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());
    }

  2. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 15 Feb 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top