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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change the marker color of the appointments in WinForms ScheduleControl?

Platform: WinForms |
Control: ScheduleControl |
Published Date: September 26, 2018 |
Last Revised Date: January 9, 2020

Customize the marker color of appointments

To customize the marker color of appointments, override the GetMarkers method of ScheduleDataProvider and define the list of markers with the required color.

 

C#

 
public class SimpleScheduleDataProvider : ScheduleDataProvider
{
   ListObjectList markerList;
    /// <summary>
    /// Get the markers for appointments
    /// </summary>
    /// <returns></returns>
    public override ILookUpObjectList GetMarkers()
    {
        return MarkerLists();
    }
 
    /// <summary>
    /// Set the marker color for appointments.
    /// </summary>
    /// <returns></returns>
    private ListObjectList MarkerLists()
    {
        markerList = new ListObjectList();
        markerList.Add(new ListObject(0, "InProgress", Color.FromArgb(50, Color.Yellow))); ////same as noMarkColor
        markerList.Add(new ListObject(1, "Done", Color.Green));
        markerList.Add(new ListObject(2, "Busy", Color.Violet));
        markerList.Add(new ListObject(3, "Out of Office", Color.Tomato));
        return markerList;
    }
}
 

VB

Public Class SimpleScheduleDataProvider
       Inherits ScheduleDataProvider
   Private markerList As ListObjectList
      ''' <summary>
      ''' Get the markers for appointments
      ''' </summary>
      ''' <returns></returns>
      Public Overrides Function GetMarkers() As ILookUpObjectList
            Return MarkerLists()
      End Function
 
      ''' <summary>
      ''' Set the marker color for appointments.
      ''' </summary>
      ''' <returns></returns>
      Private Function MarkerLists() As ListObjectList
            markerList = New ListObjectList()
            markerList.Add(New ListObject(0, "InProgress", Color.FromArgb(50, Color.Yellow))) '//same as noMarkColor
            markerList.Add(New ListObject(1, "Done", Color.Green))
            markerList.Add(New ListObject(2, "Busy", Color.Violet))
            markerList.Add(New ListObject(3, "Out of Office", Color.Tomato))
            Return markerList
      End Function
End Class
 

 

Screenshot

Customize the marked color of appointments

Sample links:

CSC#: Customizing the marker color

VB: Customizing the marker color

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon 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.Close Icon

Live Chat Icon For mobile