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

Change background colour of cell in timeline view

2 Answers 183 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 05 Mar 2013, 05:42 PM
I need to be able to change the background colour of the cell for a given day and resource in timeline view to show days when a resource is not available (weekends etc, but could be any day)

Can this be done and if so, how?

Is there a "day render" event for the ASP.Net RadScheduler that I could use and then set some style on the cell?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 08 Mar 2013, 12:01 PM
Hello Karl,

 
Thank you for contacting Telerik support.

Here is  a sample code how to achieve this by using the TimeSlotCreated event:

protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
   {
       RadScheduler scheduler = (RadScheduler)sender;
       if (scheduler.SelectedView==SchedulerViewType.TimelineView)
       {
           if (e.TimeSlot.Resource.Text=="Alex")
           {
               if (e.TimeSlot.Start.DayOfWeek == DayOfWeek.Sunday || e.TimeSlot.Start.DayOfWeek == DayOfWeek.Saturday)
               {
                   e.TimeSlot.CssClass = "Grey";
               }
           }
           
           
       }
       
        
   }
<style type="text/css">
       .Grey {
       background-color:gray;
       }
   </style>

You can also review this on-line demo where similar behavior have been implemented.

Hope this will be helpful. If you have further questions I will be glad to assist you again.

Kind regards,
Plamen
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
Karl
Top achievements
Rank 1
answered on 08 Mar 2013, 12:18 PM
Thanks, thats exactly what I was after...
Tags
Scheduler
Asked by
Karl
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Karl
Top achievements
Rank 1
Share this question
or