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

Styling appointment based on resource type.

1 Answer 36 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Antony
Top achievements
Rank 1
Antony asked on 08 Mar 2013, 02:32 AM
Hi,

I have a RadScheduler in my project and I want to style the appointment based on the resource type. I got three companies apointment in my RadScheduler and based on these company names, I want the appointments to be displayed with different styles from CS. Please help.

Thanks in advance,
Antony.

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 08 Mar 2013, 03:57 AM
Hello Antony,

You can use the AppointmentDataBound server-side event to give different styles to appointment based on the resources. Please have a look at the following code to understand how to give different styles to appointment based on the resource type from code behind.

C#:
protected void RadScheduler1_AppointmentDataBound(object sender, Telerik.Web.UI.SchedulerEventArgs e)
{
    if (e.Appointment.Resources.GetResourceByType("Company") != null)
    {
        switch (e.Appointment.Resources.GetResourceByType("Company").Text)
        {
            case "Company1":
                e.Appointment.CssClass = "rsCategoryBlue";
                break;
            case "Company2":
                e.Appointment.CssClass = "rsCategoryOrange";
                break;
            case "Company3":
                e.Appointment.CssClass = "rsCategoryGreen";
                break;
            default:
                break;
        }
    }
}

Thanks,
Princy.
Tags
Scheduler
Asked by
Antony
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or