Make only Special Days clickable

3 posts, 0 answers
  1. Hendrik Johns
    Hendrik Johns avatar
    10 posts
    Member since:
    Aug 2005

    Posted 22 Jul 2013 Link to this post

    Hi,

    Is there a way to make only dates that have been added as Special Days clickable?.

    Thanks,

    Hendrik
  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 25 Jul 2013 Link to this post

    Hello Hendrik,

    You can use the following approach:
    <telerik:RadCalendar ID="RadCalendar1" runat="server" DayStyle-CssClass="regularDay" DayOverStyle-CssClass="regularDay"
        SelectedDayStyle-CssClass="specialDay" UseColumnHeadersAsSelectors="false" UseRowHeadersAsSelectors="false">
        <ClientEvents OnDateClick="dateClick" />
        <SpecialDays>
            <telerik:RadCalendarDay IsToday="true" Repeatable="Today" ItemStyle-CssClass="specialDay">
            </telerik:RadCalendarDay>
        </SpecialDays>
    </telerik:RadCalendar>
    JavaScript:
    function dateClick(sender, args) {
        var className = args.get_renderDay().DomElement.className;
        if (!className.contains("specialDay") && !className.contains("rcSelected")) {
            args.set_cancel(true);
        }
    }
    CSS:
    .specialDay,
    .specialDay :hover
    {
        background-color: lime;
        cursor: pointer !important;
    }
     
    .regularDay,
    .regularDay :hover
    {
        cursor: default;
    }

    Hope this helps. Please give it a try and let us know if it works for you.

    Regards,
    Eyup
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Hendrik Johns
    Hendrik Johns avatar
    10 posts
    Member since:
    Aug 2005

    Posted 29 Jul 2013 Link to this post

    Hi Eyup,

    Sorry for the late response , have been on vacation.

    That was just what I was looking for :)

    Many Thanks,

    Hendrik
Back to Top