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

Appointments in different color

1 Answer 82 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Dani
Top achievements
Rank 1
Dani asked on 12 Dec 2011, 11:53 AM
In my .aspx file I have:


<style type="text/css">
.rsContent .rsContentTable .rsRow .rsSatCol,  
         .rsContent .rsContentTable .rsRow .rsSunCol   
        {  
          background:#D0ECBB;  
        }
</style>


I want for a specific cell in the scheduler to be colored green. With my code every column from Saturday and Sunday is colored. But I want only those cells which have appointments to be colored green. How to do this?

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 14 Dec 2011, 04:19 PM
Hello Dani,

You will have to handle the TimeSlotCreated event and check the count of the appointments in it's range as in the Customizing the Time Slots demo. Here is the code that should work:
protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
    {
        RadScheduler scheduler = (RadScheduler)sender;
        if (scheduler.Appointments.GetAppointmentsInRange(e.TimeSlot.Start, e.TimeSlot.End).Count != 0)
        {
            e.TimeSlot.CssClass = "color";
        }
    }

<style type="text/css">
.rsContent .rsContentTable .rsRow .rsSatCol.color, 
         .rsContent .rsContentTable .rsRow .rsSunCol.color 
        
          background:#D0ECBB; 
        }
</style>

Hope this will help.

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
Tags
Scheduler
Asked by
Dani
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or