problem in unselecting the SpecialDays

6 posts, 0 answers
  1. Kash
    Kash avatar
    8 posts
    Member since:
    Sep 2011

    Posted 01 Dec 2011 Link to this post

    I have special days added to the RadCalendar which is multiselect, and for those special days I set IsSelectable = true.
    When I unselect the selected dates using unselectDates client side function, all other dates are unselected except the special days.
    using following code to unselect;


    RadCalendar1.unselectDates(RadCalendar1.get_selectedDates())


    I am stuck, what should I do?


    Regards,
    Kash
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 Dec 2011 Link to this post

    Hello,

    Try the following code snippet.
    ASPX:
    <telerik:RadCalendar ID="RadCalendar2" runat="server" EnableMultiSelect="true" AutoPostBack="true">
     <SpecialDays>
        <telerik:RadCalendarDay Date="2011/12/12" ItemStyle-BackColor="Red"></telerik:RadCalendarDay>
        <telerik:RadCalendarDay Date="2011/12/19" ItemStyle-BackColor="Red"></telerik:RadCalendarDay>
     </SpecialDays>
    </telerik:RadCalendar>
    <asp:Button ID="btn" runat="server" Text="unselect" OnClientClick="OnClientClick();" />

    JS:
    <script type="text/javascript">
     function OnClientClick()
       {
          var calendar = $find("<%= RadCalendar2.ClientID %>");
          var dt = calendar.get_selectedDates();
          calendar.unselectDates(dt);
       }
    </script>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kash
    Kash avatar
    8 posts
    Member since:
    Sep 2011

    Posted 02 Dec 2011 Link to this post

    @Princy,

    I am dynamically adding SpecialDays. and the same client function I am calling to unselect, but no success.

    Regards,
    Kash
  5. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 02 Dec 2011 Link to this post

    Hello Kash,

    I don't believe you can unselect Special Days using the client-side API since Special Days are not selected dates, in the sense that their style will change when they are unselected. Special Days, will not show up in the SelectedDates collection if they are not selected, they will only appear on the calendar with whatever style you added to them.

    I would suggest just adding them to the SelectedDates collection, if you want them to be able to unselect the date.
  6. Kash
    Kash avatar
    8 posts
    Member since:
    Sep 2011

    Posted 15 Dec 2011 Link to this post

    Hello 

    You are wrong Kevin, If you select specialDays then it appear in the SelectedDates collection using the client-side API. And I think it is a bug of the telerik calendar control that it doesn't unselect the special days.

    I am using following line to unselect the selected dates, suggest if I am using the wrong function.

    RadCalendar1.unselectDates(RadCalendar1.get_selectedDates()) 


    Regards,
    Kash
  7. Raoul Guenette
    Raoul Guenette avatar
    8 posts
    Member since:
    Mar 2006

    Posted 29 Jul 2013 Link to this post

    I have the same problem ... Is this bug solved in a recent version? Or any workaround?
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017