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

RadDatePicker Only allow Mondays to be selected on a fortnightly basis

4 Answers 60 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 20 Jan 2017, 01:35 PM

Hi,

I'm trying to only allow users to only choose every second monday on the raddatepicker

Right now I have 

 

<SpecialDays>
    <telerik:RadCalendarDay Date="01/03/2017" Repeatable="Week" IsSelectable="false" IsDisabled="true"></telerik:RadCalendarDay>
    <telerik:RadCalendarDay Date="01/03/2017" Repeatable="Week" IsSelectable="false" IsDisabled="true"></telerik:RadCalendarDay>
    <telerik:RadCalendarDay Date="01/04/2017" Repeatable="Week" IsSelectable="false" IsDisabled="true"></telerik:RadCalendarDay>
    <telerik:RadCalendarDay Date="01/05/2017" Repeatable="Week" IsSelectable="false" IsDisabled="true"></telerik:RadCalendarDay>
    <telerik:RadCalendarDay Date="01/06/2017" Repeatable="Week" IsSelectable="false" IsDisabled="true"></telerik:RadCalendarDay>
    <telerik:RadCalendarDay Date="01/07/2017" Repeatable="Week" IsSelectable="false" IsDisabled="true"></telerik:RadCalendarDay>
    <telerik:RadCalendarDay Date="01/08/2017" Repeatable="Week" IsSelectable="false" IsDisabled="true"></telerik:RadCalendarDay>
</SpecialDays>

 

Which allows me to disable all days expect Monday. But then how do I only allow only every second monday to be clickable

And or is there another way which is better that can be done via server side coding?

4 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 25 Jan 2017, 12:39 PM
Hello John,

For disabling specific days in the RadDatePicker control you can use the approach illustrated in the code-library linked below. Note that you would need to handle both the client- and server-side DayRender events.



Regards,
Viktor Tachev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Matt
Top achievements
Rank 1
answered on 16 Aug 2018, 07:56 PM

For anyone else who comes across this. The proposed solution does not work.

Telerik Ajax 2015 Q2

... keep Googling...

0
Matt
Top achievements
Rank 1
answered on 16 Aug 2018, 08:14 PM

I should be more specific... the server side works but the client side is never triggered. I have a requirement to allow only Mondays be "selectable" if another criteria is true. 

Suggestion: provide a means of identifying what days of the week are selectable (without referring to someone elses very old work).

0
Marin Bratanov
Telerik team
answered on 20 Aug 2018, 12:30 PM
Hi Matt,

Could you post the code that shows the problem? The example my colleague Viktor linked is actually something Telerik created in 2007. I'm attaching here a modified version that targets Mondays and a short video that shows the expected behavior I get. While comparing this with the problematic setup, I recommend monitoring the console for errors, as they are a likely reason for broken functionality.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Calendar
Asked by
John
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Matt
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or