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

How to make only special days selectable?

1 Answer 80 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 03 Jan 2008, 05:22 PM
I am trying to create a calendar  (DatePicker) where only the special days are selectable.  However, I did not see a way to make days non-selectable by default.

I tried adding recurring special days for each day of the week which are non-selectable and then overlaying that with the special days that are selectable. 

This worked somewhat, but isn't stable.  When I change months some of the special days become non-selectable.  It seems to be at the mercy of the browser deciding which style gets applied last.

Do you have a suggested way of accomplishing this in Prometheus?

Thanks,
Chris Beck

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 04 Jan 2008, 04:04 PM
Hi Chris,

Unfortunately, the control does not allow you to set all dates as non-selectable by default. You can handle the OnDateSelecting client-side event of the calendar control and cancel the selection if the user is currently trying to select a day that is not marked as special one (you could extract the special days info either with the specialDaysArray approach described in the other support ticket you have opened on the topic, or you can pass all special days' dates in a hidden input field from the server to the client, parse them on the client-side, and use them to control the selection logic).

Hope this helps.


Sincerely yours,
Manuel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Calendar
Asked by
Chris
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or