Appointment: set bordercolor and text outside border

6 posts, 0 answers
  1. Egbert
    Egbert avatar
    21 posts
    Member since:
    Dec 2010

    Posted 18 Dec 2013 Link to this post

    Hi,

    In the AppointDataBound event I'm setting the colors of the border, background and text.
    It works fine for background and text, but not for the border.

    e.Appointment.BorderColor = System.Drawing.Color.FromName(borderColor);
    e.Appointment.BackColor = System.Drawing.Color.FromName(backgroundColor);
    e.Appointment.ForeColor = System.Drawing.Color.FromName(textColor);

    I'm using the hex format for the color names. (#2d14eb)
    How can I also set this for the border color?

    When using these colors, the text displayed in the appointment will now be displayed outside the border if longer than the box itself.
    (see attachment)
    When not setting the colors myself, so using the standard style, text will not be displayed outside the box.

    Thanks and best regards,
    Egbert
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Dec 2013 Link to this post

    Hi Egbert ,

    As a work around please try the following code snippet which works fine at my end.

    C#:
    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
            int borderColorValue = 2954475; // this value is equal to #2d14eb
            e.Appointment.BorderColor = Color.FromArgb(borderColorValue);
    }

    Please try to set the appropriate RowHeight for the RadScheduler to show the text inside the Border. Please take a look into the following attachment.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Egbert
    Egbert avatar
    21 posts
    Member since:
    Dec 2010

    Posted 20 Dec 2013 Link to this post

    Hi,

    The border color works great now, thanks.

    Regarding the text outside the box problem:

    We are displaying a lot of info and I can not set the rowheight so large that it will fit all the info (see attachment).
    It works fine if not using my own colors and using the default style.

    Best regards,
    Egbert
  5. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 25 Dec 2013 Link to this post

    Hi Egbert,

    Can you try to apply a custom css class to the appointments: 
    <style type="text/css">
        .RadScheduler .MyCustomAppointmentStyle .rsAptContent,
        .RadScheduler .MyCustomAppointmentStyle .rsAptMid .rsAptIn,
        .RadScheduler .MyCustomAppointmentStyle .rsAptMid,
        .RadScheduler .MyCustomAppointmentStyle .rsAptOut {
            background-image: url('Scheduler/MyCustomBackgroundImage.png');
        }
     
        .RadScheduler .MyCustomAppointmentStyle .rsAptContent {
            border-color: #2d14eb;
        }
    </style>

    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        e.Appointment.CssClass = "MyCustomAppointmentStyle";
    }

    Regards,
    Hristo Valyavicharski
    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.
  6. Egbert
    Egbert avatar
    21 posts
    Member since:
    Dec 2010

    Posted 04 Mar 2014 in reply to Hristo Valyavicharski Link to this post

    Hi,

    I've change the style a little bit like this and it works fine, no text outside the box.

     .RadScheduler .MyCustomAppointmentStyle .rsAptContent,
        .RadScheduler .MyCustomAppointmentStyle .rsAptMid .rsAptIn,
        .RadScheduler .MyCustomAppointmentStyle .rsAptMid,
        .RadScheduler .MyCustomAppointmentStyle .rsAptOut {
            background-image: url('Scheduler/MyCustomBackgroundImage.png');
            border-color: Red;
            background-color: Yellow;
        }

    But how can I now change the color from code?

    Thanks and best regards,
    Egbert












  7. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 07 Mar 2014 Link to this post

    Hi Egbert,

    You may create multiple classes for the different colors MyCustomAppointmentStyle1, MyCustomAppointmentStyle2,MyCustomAppointmentStyle3. Then on the server set the appropriate class.

    Regards,
    Hristo Valyavicharski
    Telerik

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017