I was wondering if it is possible to change the background color of the timeslot of the radscheduler control at runtime? I'm looking for the kind of functionality that the specialdays has with the radcalendar control, but I don't know what event I should hook up to or if it is even possible.
Thanks,
Marcello
Thanks,
Marcello
6 Answers, 1 is accepted
0
Accepted
Hello Marcello,
RadScheduler now has the TimeSlotCreated event which you can use to set the CssClass property of the TimeSlot:
All the best,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
RadScheduler now has the TimeSlotCreated event which you can use to set the CssClass property of the TimeSlot:
| protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e) |
| { |
| e.TimeSlot.CssClass = "MyCustomClass"; |
| } |
All the best,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
mdonato
Top achievements
Rank 1
answered on 02 May 2008, 06:29 PM
That works great.
Here is the css I used incase anyone is struggling with the same issue.
e.TimeSlot.CssClass =
"halfday"
Here is the css I used incase anyone is struggling with the same issue.
td.halfday>div
{
background-color:#ff9696;
}
Unless you put the >div selector in there it will not change the background color.
0
Albert
Top achievements
Rank 1
answered on 27 Jun 2008, 06:34 PM
This works fine in Month view but have you gotten it to work in Day or week view?
0
Hello Albert,
Please, try the following selectors which should work for all views:
Regards,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Please, try the following selectors which should work for all views:
| /*Day, Week, and MonthView*/ |
| div.rsContent .rsCell.MyCustomClass |
| { |
| background: gray; |
| } |
| /*Timeline view*/ |
| div.rsContent .rsTimelineTable .MyCustomClass |
| { |
| background: gray; |
| } |
Regards,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Albert
Top achievements
Rank 1
answered on 30 Jun 2008, 12:12 PM
Thank you! I have also found that the previous example will work if you include the !important directive.
td.halfday>div
{
background-color:#ff9696 !important;
}
0
Yes, "!important" always adds the greatest weight to the css selector.
Kind regards,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center