Adding e.Appointment.Attributes.CssStyle not working

4 posts, 0 answers
  1. Jens
    Jens avatar
    2 posts
    Member since:
    Mar 2014

    Posted 16 Sep 2014 Link to this post

    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
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 18 Sep 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jens
    Jens avatar
    2 posts
    Member since:
    Mar 2014

    Posted 18 Sep 2014 in reply to Boyan Dimitrov Link to this post

    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
  5. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 23 Sep 2014 Link to this post

    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.

     
Back to Top