How to make only special days selectable?

2 posts, 0 answers
  1. Chris
    Chris avatar
    5 posts
    Member since:
    Jan 2008

    Posted 03 Jan 2008 Link to this post

    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
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 04 Jan 2008 Link to this post

    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
Back to Top