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

Appointment: set bordercolor and text outside border

5 Answers 167 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Egbert
Top achievements
Rank 1
Egbert asked on 18 Dec 2013, 06:55 AM
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

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Dec 2013, 09:28 AM
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.
0
Egbert
Top achievements
Rank 1
answered on 20 Dec 2013, 08:26 AM
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
0
Hristo Valyavicharski
Telerik team
answered on 25 Dec 2013, 08:38 AM
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.
0
Egbert
Top achievements
Rank 1
answered on 04 Mar 2014, 02:47 PM
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












0
Hristo Valyavicharski
Telerik team
answered on 07 Mar 2014, 02:16 PM
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.

Tags
Scheduler
Asked by
Egbert
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Egbert
Top achievements
Rank 1
Hristo Valyavicharski
Telerik team
Share this question
or