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

Radscheduler TimelineView Row Background

6 Answers 66 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Zeo
Top achievements
Rank 1
Zeo asked on 18 Mar 2012, 01:07 AM
Dear all,

We are using the RadScheduler in TimelineView, grouped by employee..
Can we set the background-color by row programmatically? Would like to have a slight different color on the odd lines, like commonly seen in the RadGrid.

Cheers, Zeo Smeijsters

6 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 22 Mar 2012, 08:51 AM
Hello Zeo,

 
You can handle the TimeSlotCreated event and add the desired css class as in the code:

protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
   {
       if (e.TimeSlot.Resource.Text=="Alex" || e.TimeSlot.Resource.Text=="Charlie")
       {
           e.TimeSlot.CssClass = "red";
       }
   }
.red
    {
        background-color:Red !important;
        }

Hope this will be helpful.

Regards,
Plamen Zdravkov
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
Zeo
Top achievements
Rank 1
answered on 22 Mar 2012, 05:10 PM
Great!!!! Thanks, did not think(know) there is an TimeSlotCreated event.

My solution:
.RowOdd
{
    background-color:#E6F4F7!important;
}

        protected void RadScheduler1_TimeSlotCreated(object sender, Telerik.Web.UI.TimeSlotCreatedEventArgs e)
        {
            string index = e.TimeSlot.Index;
            index = index.Substring(0,index.IndexOf(':'));
 
            if (Convert.ToInt32(index) % 2 == 1)
            {
                e.TimeSlot.CssClass = "RowOdd";
            }
        }
0
Kamlesh
Top achievements
Rank 1
answered on 23 Mar 2012, 11:22 AM
We have to change the back color of scheduler based on Office hour of employee (DayStartTime and DayEndTime).
Thanks & Regards
Kamlesh
0
Plamen
Telerik team
answered on 23 Mar 2012, 03:23 PM
Hi Kamlesh,

 
You can use the e.TimeSlot.Start.Hour in the TimeSlotCreated event as it is done in the Customize Time Slot demo.

Hope this will be helpful.

Greetings,
Plamen Zdravkov
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
Kamlesh
Top achievements
Rank 1
answered on 26 Mar 2012, 08:37 AM
Thanks
0
Mats
Top achievements
Rank 1
answered on 04 Oct 2013, 08:29 AM
You Sir Rock.
there ain't enough words to describe the awsomeness of you row color solution..

Thanks for posting it, trying to do this for some time now.

/Mats
Tags
Scheduler
Asked by
Zeo
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Zeo
Top achievements
Rank 1
Kamlesh
Top achievements
Rank 1
Mats
Top achievements
Rank 1
Share this question
or