RadCalendar with EnableMultiSelect loses specialdays data upon navigation

2 posts, 0 answers
  1. Sivakumar Chandran
    Sivakumar Chandran avatar
    1 posts
    Member since:
    Dec 2009

    Posted 23 Dec 2009 Link to this post

    This is the definition we have in .aspx



    <telerik:RadCalendar ID="RadCalendar2" runat="server" Font-Names="Arial,Verdana,Tahoma"




    ForeColor="Black" Skin="Outlook" Style="border-color: #ececec"




    EnableViewSelector="True" AutoPostBack="false">








    A function with the following lines is called on pageload:






    RadCalendarDay NewDay = new RadCalendarDay(RadCalendar2);




    foreach (DataRow drrow in dtALLDates.Rows)



    NewDay =

    new RadCalendarDay(RadCalendar2);


    NewDay.Date =



    NewDay.ToolTip =

    Convert.ToInt32(drrow["SeatsAvailable"]) > 0 ? Convert.ToInt32(drrow["SeatsAvailable"]) > 1 ? drrow["SeatsAvailable"] + " seats are available" : "1 seat is available"






    Convert.ToInt32(drrow["InSchedule"]) == 0 ? "Session not offered or it is a holiday." : "Seats are not available.";



    Boolean bselect = Convert.ToInt32(drrow["SeatsAvailable"]) > 0 && Convert.ToBoolean(drrow["AllowEdit"]) == true ? true : false;


    NewDay.IsSelectable = bselect;


    if (Convert.ToBoolean(drrow["IsOpted"]) == true)



    NewDay.IsSelected =




    new RadDate(Convert.ToDateTime(drrow["CalendarDate"].ToString())));





    When we navigate from one month to another month, the highlighted dates are cleared. I tried lot of things. But nothing working. Please help me to come out of this issue.

    Thanks a lot in advance.


  2. Radoslav
    Radoslav avatar
    1566 posts

    Posted 29 Dec 2009 Link to this post

    Hi Siva,

    I looked through your code and I think that the problem is caused by the following code line:

    NewDay.IsSelectable = bselect;

    This code made the date in NewDay not selectable, however the next few rows of code select some of the dates:

    if (Convert.ToBoolean(drrow["IsOpted"]) == true)
        NewDay.IsSelected = true;

    In some cases this code selects dates which are set to be not selectable.
    Additionally I am attaching a simple example based on your code.
    I hope this helps.

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top