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

Can't apply CSS class to weekends

1 Answer 74 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Norman
Top achievements
Rank 1
Norman asked on 22 Feb 2011, 06:46 PM
Hello,

I am able to successfully modify the CSS style for the purpose of applying a background color to any weekday but not to a weekend.

Protected Sub RadScheduler1_TimeSlotCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.TimeSlotCreatedEventArgs) Handles RadScheduler1.TimeSlotCreated
      If (DateTime.Compare(e.TimeSlot.Start.[Date], RadScheduler1.SelectedDate) = 0) Then
          e.TimeSlot.CssClass = "SelectedDate"
      End If
      If e.TimeSlot.Start.[Date].DayOfWeek = DayOfWeek.Saturday Then
          e.TimeSlot.CssClass = "SelectedDate"
      End If
End Sub

The SelectedDate receives the CSS class "SelectedDate" unless it is a weekend. Furthermore, I cannot simply apply the CSS class to the weekend. I am using x. 2010.3.1317.40.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Norman
Top achievements
Rank 1
answered on 22 Feb 2011, 08:32 PM
I answered my own question. In order to get the weekends to pick up a declared CSS class, it has to have the !important attribute.

Thus,
.SelectedDate { background-color:#FFB675; }
became
.SelectedDate { background-color:#FFB675 !important; }

I hope this helps someone!
Tags
Scheduler
Asked by
Norman
Top achievements
Rank 1
Answers by
Norman
Top achievements
Rank 1
Share this question
or