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

Adding e.Appointment.Attributes.CssStyle not working

3 Answers 95 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jens
Top achievements
Rank 1
Jens asked on 16 Sep 2014, 07:32 AM
Hello,

I am trying to set a custom color to my appointments, e.Appointment.BorderColor is not enough I need to set a
argb color. It worked for me with the headers but when I add e.Appointment.Attributes.CssStyle I can't find it
back in my HTML. Am I missing something?

Greeting

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 18 Sep 2014, 03:23 PM
Hello,

Please review Setting styles for appointments help article that demonstrates some techniques about applying different styles for the appointment on the server-side.


Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jens
Top achievements
Rank 1
answered on 18 Sep 2014, 03:36 PM
Hey Boyan,

I saw the article but I cant use rgba colors as I explained in my question. Is there a wat tot set the HTML style attributen?

Greetings
0
Boyan Dimitrov
Telerik team
answered on 23 Sep 2014, 12:48 PM
Hello,

There are two possible solutions for your case:

     1. Use the RadScheduler AppointmentDataBound event handler and add a custom class to the appointment object.
//code behind
protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        e.Appointment.CssClass = "MyCustomAppointmentStyle";
    }

The attached screenshot shows where this custom class is applied.

     2. To use color translator in order to convert the hex color value in System.Drawing.Color
//code behind
string hex = "#FFFFFF";
Color _color = System.Drawing.ColorTranslator.FromHtml(hex);

and use the suggested article.

Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Scheduler
Asked by
Jens
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Jens
Top achievements
Rank 1
Share this question
or