We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Custom Appointment BackColor

Thread ID:

Created:

Updated:

Platform:

Replies:

132583 Sep 10,2017 11:33 AM Sep 12,2017 02:45 AM Windows Forms 3
loading
Tags: ScheduleControl
darik
Asked On September 10, 2017 11:33 AM

Hello! I'm really enjoying the product, but I have a question: How do I set a custom color for Schedule Appointment items ?, I already use the values of item.LabelValue = 2; but I want to customize with any color system color, for example: item.LabelValue = Color.Tomato. I already tried the item.BackColor = Color.Tomato, but without any result. 

Thaks in advance!

Mohanraj Gunasekaran [Syncfusion]
Replied On September 11, 2017 07:42 AM

Hi Ary, 

Thanks for your interest in Syncfusion products.  
 
We could able to understand your scenario and created the simple sample based your requirement. In order to change the label colors, use the custom ScheduleDataProvider and override the InitLists method. In that method, you can change the LabelValue colors to change the appointment backColor. Please make use of the below code,  
 
Code snippet:  
public class SimpleScheduleDataProvider : ScheduleDataProvider  
{  
    /// <summary>  
    /// Default constructor.  
    /// </summary>  
    public SimpleScheduleDataProvider()  
        : base()  
    {  
    }  
    public override void InitLists()  
    {  
        base.InitLists();  
  
        ///Suggestion 1  
        this.LabelList[0].ColorMember = Color.Black;  
        this.LabelList[1].ColorMember = Color.Red;  
        this.LabelList[2].ColorMember = Color.Purple;  
        this.LabelList[3].ColorMember = Color.Yellow;  
        this.LabelList[4].ColorMember = Color.Pink;  
        this.LabelList[5].ColorMember = Color.YellowGreen;  
        this.LabelList[6].ColorMember = Color.Violet;  
        this.LabelList[7].ColorMember = Color.Tomato;  
        this.LabelList[8].ColorMember = Color.SpringGreen;  
        this.LabelList[9].ColorMember = Color.SandyBrown;  
        this.LabelList[10].ColorMember = Color.RosyBrown;  
  
        ///Suggestion 2  
          
        //this.LabelList = new ListObjectList();  
        //this.LabelList.Add(new ListObject(0, "None", Color.White));  
        //this.LabelList.Add(new ListObject(1, "Important", Color.Red));  
        //this.LabelList.Add(new ListObject(2, "Business", Color.Purple));  
        //this.LabelList.Add(new ListObject(3, "Personal", Color.Yellow));  
        //this.LabelList.Add(new ListObject(4, "Vacation", Color.Pink));  
        //this.LabelList.Add(new ListObject(5, "Must Attend", Color.YellowGreen));  
        //this.LabelList.Add(new ListObject(6, "Travel Required", Color.Violet));  
        //this.LabelList.Add(new ListObject(7, "Needs Preparation", Color.Tomato));  
        //this.LabelList.Add(new ListObject(8, "Birthday", Color.SpringGreen));  
        //this.LabelList.Add(new ListObject(9, "Anniversary", Color.SandyBrown));  
        //this.LabelList.Add(new ListObject(10, "Phone Call", Color.RosyBrown));  
    }  
}  
  
Sample link:  
 
Please let us know if you have any other queries,  
 
Note: 
We do not have the direct support to change the backcolor for appointments like “item.LabelValue = Color.Red”.  
 
Regards,  
Mohanraj G 
 


darik
Replied On September 11, 2017 10:08 AM

Thanks for the reply worked perfectly! But I really need to list more than 10 colors in the list, is it possible?


Mohanraj Gunasekaran [Syncfusion]
Replied On September 12, 2017 02:45 AM

Hi Ary,  
 
Thanks for your update. 
 
Yes, it is possible. In order to add more number of colors for appointments, you can use our second suggestion as we provided the code example in our previous update and attached sample. Please refer to the below code example, 
 
Code example 
this.LabelList = new ListObjectList(); 
this.LabelList.Add(new ListObject(0, "None", Color.White)); 
this.LabelList.Add(new ListObject(1, "Important", Color.Red)); 
this.LabelList.Add(new ListObject(2, "Business", Color.Purple)); 
this.LabelList.Add(new ListObject(3, "Personal", Color.Yellow)); 
this.LabelList.Add(new ListObject(4, "Vacation", Color.Pink)); 
this.LabelList.Add(new ListObject(5, "Must Attend", Color.YellowGreen)); 
this.LabelList.Add(new ListObject(6, "Travel Required", Color.Violet)); 
this.LabelList.Add(new ListObject(7, "Needs Preparation", Color.Tomato)); 
this.LabelList.Add(new ListObject(8, "Birthday", Color.SpringGreen)); 
this.LabelList.Add(new ListObject(9, "Anniversary", Color.SandyBrown)); 
this.LabelList.Add(new ListObject(10, "Wedding function", Color.RosyBrown)); 
this.LabelList.Add(new ListObject(11, "Birthday Party", Color.DarkSalmon)); 
this.LabelList.Add(new ListObject(12, "Meeting", Color.DarkOliveGreen)); 
this.LabelList.Add(new ListObject(13, "Playing", Color.DarkSlateBlue)); 
 
Please let us know if you have any concerns. 

Regards, 
Mohanraj G  
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;