Appointments in different color

2 posts, 0 answers
  1. Dani
    Dani avatar
    20 posts
    Member since:
    Dec 2011

    Posted 12 Dec 2011 Link to this post

    In my .aspx file I have:
    <style type="text/css">
    .rsContent .rsContentTable .rsRow .rsSatCol,  
             .rsContent .rsContentTable .rsRow .rsSunCol   

    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?
  2. Plamen
    Plamen avatar
    3079 posts

    Posted 14 Dec 2011 Link to this post

    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 

    Hope this will help.

    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
Back to Top