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

[Solved] Background cell color for specific day

1 Answer 148 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Marilyn Ounjian
Top achievements
Rank 1
Marilyn Ounjian asked on 23 Jun 2008, 06:47 PM
I know I can control the color of all cells or a set of cells (e.g. Sat column) but how do I control the background color of a specific cell. For example if I wanted all user defined holidays to be yellow (the entrie cell not just an appt) how would I do this? Thanks.

1 Answer, 1 is accepted

Sort by
0
mdonato
Top achievements
Rank 1
answered on 23 Jun 2008, 07:35 PM

Here's code that might help. Handle the TimeSlotCreated event of the scheduler.   

'Render different colors for different schedules.
Protected Sub RadScheduler1_TimeSlotCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.TimeSlotCreatedEventArgs) Handles RadScheduler1.TimeSlotCreated

        Dim calDay As BusinessObjects.ScheduleObjects.CalendarDay = BusinessObjects.ScheduleObjects.CalendarDay.GetCalendarDay(e.TimeSlot.Start)
        Select Case calDay.DailySchedulesID
            Case 1
                e.TimeSlot.CssClass = "noschool"
            Case 2
                e.TimeSlot.CssClass = "halfday"
            Case 3
                e.TimeSlot.CssClass = "facultymeeting"
            Case 4
                e.TimeSlot.CssClass = "morningassembly"
        End Select
    End Sub

and here's the css:

td.noclasses>div
{
 background-color:#ff3149;
}
td.halfday>div
{
 background-color:#ff9696;
}
td.facultymeeting>div
{
 background-color:#feff97;
}
td.morningassembly>div
{
 background-color:#bafcfb;
}

Tags
Scheduler
Asked by
Marilyn Ounjian
Top achievements
Rank 1
Answers by
mdonato
Top achievements
Rank 1
Share this question
or