0

I have a telerik Radscheduler and want to give specific days a different background color. I prefer to give the whole column a different class for the specific date, but only the date header row would also be good.

Searched the internet, but could only find changing appointment background colors.

Mario
  • 582
  • 5
  • 18

1 Answers1

0

got the solution on the telerik-forum:

An easy and convenient way of achieving such functionality would be using the RadScheduler TimeSlotCreated server-side event and apply a css class to all time slot objects associated with a specific date as shown in the code snippet below:

Markup code:

<telerik:RadScheduler runat="server" ID="RadScheduler1" OnTimeSlotCreated="RadScheduler1_TimeSlotCreated"></telerik:RadScheduler>

Code behind:

protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
    {
        if (RadScheduler1.SelectedView == SchedulerViewType.WeekView)
        {
            if (e.TimeSlot.Start.Date.Day == 23 )
            {
                e.TimeSlot.CssClass = "red";
            }
        }
    }

css code:

<style type="text/css">
       html .RadScheduler .red {
           background: red;
       }
   </style>

Special thanks to Boyan Dimitrov of Telerik

Mario
  • 582
  • 5
  • 18