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

[Solved] Different Colors For Appointment

5 Answers 341 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
nagesh Mynedi
Top achievements
Rank 1
nagesh Mynedi asked on 23 Oct 2009, 10:40 AM
How can I Put Different colors for weekdays in Appointment...LIke sunday toSaturday..

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Oct 2009, 11:46 AM
Hi Nagesh,

You can change the appointment appearance in ItemDataBound event based on condition as shown below.

C#:
 
protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e) 
    if (e.Appointment.Start.DayOfWeek == DayOfWeek.Saturday || e.Appointment.Start.DayOfWeek == DayOfWeek.Sunday) 
    { 
        e.Appointment.BackColor = System.Drawing.Color.Red; 
 
    } 
    else 
    { 
        e.Appointment.BackColor = System.Drawing.Color.Blue; 
    } 

Also checkout the documentation that shows how to set styles for appointment.

-Shinu.
0
nagesh Mynedi
Top achievements
Rank 1
answered on 23 Oct 2009, 12:36 PM
HI friend thanks ..but it was not working.....
0
Peter
Telerik team
answered on 23 Oct 2009, 01:25 PM
Hi nagesh,

Perhaps, you need to put different color to the time slots, not the appointments. If that's the case, please see this kb article:
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/setting-special-days-or-time-slots-in-radscheduler.aspx

Regards,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
nagesh Mynedi
Top achievements
Rank 1
answered on 24 Oct 2009, 05:06 AM
Thanks for giving this..i wan to put different colors for days like sunday=green ,monday=blue tuesday=red wenesday=black ............................... like this..
0
Shinu
Top achievements
Rank 2
answered on 27 Oct 2009, 06:02 AM
Hi Nagesh,

I tried following code in order to set different styles for timeslots of RadScheduler. Give a try with following code and see whether it helps.

CSS:
 
<style type="text/css"
    .Monday 
    { 
        background-colorblue !important; 
    } 
    .Sunday 
    { 
        background-colorgreen  !important; 
    } 
    .Wednesday 
    { 
        background-colorblack  !important; 
    } 
    .Tuesday 
    { 
        background-colorred  !important; 
    } 
</style> 

C#:
 
protected void RadScheduler1_TimeSlotCreated(object sender, Telerik.Web.UI.TimeSlotCreatedEventArgs e) 
    switch (e.TimeSlot.Start.Date.DayOfWeek) 
    { 
        case DayOfWeek.Monday: 
            e.TimeSlot.CssClass = "Monday"
            break
        case DayOfWeek.Sunday: 
            e.TimeSlot.CssClass = "Sunday"
            break
        case DayOfWeek.Wednesday: 
            e.TimeSlot.CssClass = "Wednesday"
            break
        case DayOfWeek.Tuesday: 
            e.TimeSlot.CssClass = "Tuesday"
            break
        default
            break
    } 

-Shinu.
Tags
Scheduler
Asked by
nagesh Mynedi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
nagesh Mynedi
Top achievements
Rank 1
Peter
Telerik team
Share this question
or