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

Radcalendar hover issue

2 Answers 130 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aditya
Top achievements
Rank 1
Aditya asked on 16 Apr 2012, 09:25 AM
Hi.,
  I'm using RadCalendar to select highlighted days. The issue is that whenever I hover on these highlighted dates., the date gets selected, which shouldn't be the case. I want the date to get selected only when i click it but no on hover. How can i overcome this issue..??
I'm using this css class to highlight special days
   .CalendarHolidays a
    {
        color: red !important;
        font-weight: bold !important;
        background-color: #f2f2f2 !important;
    }

Regards,
Aditya

2 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 16 Apr 2012, 02:29 PM
Hello Aditya,

You could disable the applying of the rcHover class to the cells by overriding the ApplyHoverBehavior function:

Telerik.Web.UI.Calendar.RenderDay.prototype.ApplyHoverBehavior = function(){return false;};


Kind regards,
Vasil
the Telerik team
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 their blog feed now.
0
James
Top achievements
Rank 1
answered on 18 Dec 2012, 10:12 AM
This problem occurs when using CSS to highlight special days. If you highlight the days through code, hovering over the dates will not change the colour back. Thought I would reply to this post as I have seen this question repeated over and over again and the only solution telerik provide is via CSS which with telerik stuff can be a pain sometimes. The code way is so much simpler:

allExpiryDates is a list of datetimes and calendarEvents is the id of my radcalendar

   public void RadCalendar_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
    {
        foreach (DateTime expiryDate in allExpiryDates)
        {
            DateTime dateToHighlight = new DateTime();
            dateToHighlight = expiryDate;
            RadCalendarDay calendarDay = new RadCalendarDay();
            calendarDay.Date = dateToHighlight;
            calendarDay.ItemStyle.BorderColor = Color.Blue;
            calendarEvents.SpecialDays.Add(calendarDay);
        }
    }
Tags
General Discussions
Asked by
Aditya
Top achievements
Rank 1
Answers by
Vasil
Telerik team
James
Top achievements
Rank 1
Share this question
or