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

Changing background color for each appointment in radscheduler

9 Answers 1043 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
good
Top achievements
Rank 1
good asked on 28 Feb 2011, 12:28 PM

Can I change the background color of the appointment according to my database info.

 

For example:

 

If am having several category

Category 1

Category 2

Category 3

Category 4

 

I want category 1 appointment in the scheduler to be blue\

Category 2 green

Category 3 red

Category 4 yellow

 

By the way am just retrieving the data from my database.

 

Thanks in advance

9 Answers, 1 is accepted

Sort by
0
Dobry Zranchev
Telerik team
answered on 02 Mar 2011, 02:16 PM
Hi good,

Thank you for writing.

You are able to add your own background in the Backgrounds collection of the RadScheduler. Each background info has an Id property that should be unique. If you create an appointment and set its BackgroundId property to your custom background, the appointment will be painted in the colors of the custom background. You can find the available documentation about this topic here.

If you have other related questions, feel free to write back.

Best wishes,
Dobry Zranchev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
khalid
Top achievements
Rank 1
answered on 02 Oct 2015, 03:52 PM

Hi,

 

Have you got answer of your query i have same problem. Can you please pass me your code.

thanks.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 Oct 2015, 12:58 PM
Hello Khalid,

Thank you for writing.

AppointmentElement's back color is determined by the selected Background. However, in order to customize the color, you can use the AppointmentFormatting event and specify what is the desired color:
private void radScheduler1_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
{
    e.AppointmentElement.DrawFill = true;
    e.AppointmentElement.BackColor = Color.Aqua;
    e.AppointmentElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
}

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Aref
Top achievements
Rank 1
answered on 21 Nov 2015, 11:24 AM
Hi 
I have got problem to retrieve appointment background color, every time I save an appointment it's background color change to default value. I am also sure that the mapping is right because the background ID is saved correctly. Could you please help me with this problem.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Nov 2015, 03:02 PM
Hello Aref,

Thank you for writing.

The SchedulerMapping class is responsible for mapping a single property from the data source to a property, which allows you to specify convert callback methods in order to convert values to and from the data source if needed. Please refer to the following help article which demonstrates how to convert the BackgroundId from database: http://www.telerik.com/help/winforms/scheduler-data-binding-scheduler-mapping.html

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Aref
Top achievements
Rank 1
answered on 23 Nov 2015, 08:04 PM
Dear Dess
Thanks for your reply but my problem still remains, I create those functions but when I load my scheduler appointments, their background color are set to None, I should mentioned that I put those functions on my form constructor's and  when I save appointments they background are correct. 
0
Aref
Top achievements
Rank 1
answered on 23 Nov 2015, 08:20 PM

Dear Dess
I should edit my last post that I put recalling to those functions in my form constructor's and load event.
Sincerely yours
Aref

0
Aref
Top achievements
Rank 1
answered on 23 Nov 2015, 09:01 PM

Dear Dess
Sorry for bothering you to much with my posts, please ignore my post, my problem solved.
Thanks for your help.

Sincerely yours 
Aref

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Nov 2015, 08:37 AM
Hello Aref,

Thank you for writing back.

I am glad that the problem you were facing is now resolved. If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Scheduler and Reminder
Asked by
good
Top achievements
Rank 1
Answers by
Dobry Zranchev
Telerik team
khalid
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Aref
Top achievements
Rank 1
Share this question
or