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

problem in unselecting the SpecialDays

5 Answers 100 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Kash
Top achievements
Rank 1
Kash asked on 02 Dec 2011, 05:48 AM
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

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Dec 2011, 07:56 AM
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.
0
Kash
Top achievements
Rank 1
answered on 02 Dec 2011, 01:32 PM
@Princy,

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

Regards,
Kash
0
Kevin
Top achievements
Rank 2
answered on 02 Dec 2011, 04:21 PM
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.
0
Kash
Top achievements
Rank 1
answered on 15 Dec 2011, 08:56 AM
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
0
Raoul Guenette
Top achievements
Rank 1
answered on 29 Jul 2013, 07:59 PM
I have the same problem ... Is this bug solved in a recent version? Or any workaround?
Tags
Calendar
Asked by
Kash
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kash
Top achievements
Rank 1
Kevin
Top achievements
Rank 2
Raoul Guenette
Top achievements
Rank 1
Share this question
or