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

Formatting resources section

4 Answers 18 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mattia
Top achievements
Rank 1
Mattia asked on 02 Sep 2013, 12:40 PM
Hi, i have a radscheduler with many resources. 
There is a way to set color or background color to the resources labels?
I have to set different colors by a condition, so i have to do that by code.
It's possible?

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 02 Sep 2013, 01:27 PM
Hi Mattia,

You can attach the AppointmentDataBound server side event and try the following C# code.

C#:
protected void RadScheduler1_AppointmentDataBound(object sender, Telerik.Web.UI.SchedulerEventArgs e)
{
    if (e.Appointment.Resources.GetResourceByType("Product") != null)
    {
        switch (e.Appointment.Resources.GetResourceByType("Product").Text)
        {
            case "Mobile":
                e.Appointment.CssClass = "blue-style";
                break;
            case "Laptop":
                e.Appointment.CssClass = "green-style";
                break;
            default:
                break;
        }
    }
}

Thanks,
Shinu.
0
Mattia
Top achievements
Rank 1
answered on 02 Sep 2013, 01:56 PM
Hi, thank you for the reply, 
but i have to set the font-color or insert an image near the resource label not formatting the appointment.
I attach an image for show where i have to change the color
0
Accepted
Boyan Dimitrov
Telerik team
answered on 05 Sep 2013, 12:26 PM
Hello,

Please refer to the following demo showing how you can use the server-side event OnResourceHeaderCreated.

Regards,
Boyan Dimitrov
Telerik
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 the blog feed now.
0
Mattia
Top achievements
Rank 1
answered on 06 Sep 2013, 01:01 PM
Thank you,
I set the cssClass property to the header label in the OnResourceHeaderCreated event and it's works.
Tags
Scheduler
Asked by
Mattia
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Mattia
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or