Can't apply CSS class to weekends

2 posts, 0 answers
  1. Norman
    Norman avatar
    2 posts
    Member since:
    Jan 2011

    Posted 22 Feb 2011 Link to this post

    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!
  2. Norman
    Norman avatar
    2 posts
    Member since:
    Jan 2011

    Posted 22 Feb 2011 Link to this post

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