Articles in this section
Category / Section

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

1 min read

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 in 
our WinForms ScheduleControl.

 

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

Customized marked color in appointments as shown in the screenshot below

Customize the marked color of appointments


Conclusion


I hope you enjoyed learning about how to change the marker color of the appointments in ScheduleControl.


You can refer to our WinForms ScheduleControl feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms ScheduleControl documentation to understand how to manipulate data.


For current customers you can check out on our Winforms components from the License and Download page. If you are new to Syncfusion, you can try our 30-day free trial to check out our Winforms ScheduleControl and other WinForms components.


If you have any queries or require clarifications, please let us know in the comment section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied