New to Telerik UI for WinUI? Download free 30-day trial

Time Markers

RadScheduler provides you with a built-in time markers support. You can assign a time marker to each one of your appointments, thus making them easily distinguishable.

Assign Time Marker to an Appointment run-time

Run-time you can define the time marker of your appointment via the drop down menu in the EditAppointmentDialog.

Adding TimeMarkers to the RadScheduler

By default the RadScheduler has predefined list of time markers i.e. "Free", "Tentative", "Busy", "Out Of Office", etc.

However, there are cases when new time markers are needed and you have to create them on your own, as it is shown below.

Each time marker has three important characteristics:

  1. TimeMarkerName: Each time marker has a name assigned. It is used to distinguish that time marker amongst the others in your application.

  2. TimeMarkerBrush: Each category has a color brush assigned.

The time markers available in the RadScheduler are defined in the TimeMarkersSource property (IEnumarable). Just add or remove time markers to that collection in order to add or remove time markers to the RadScheduler itself.

Example 1

<telerik:RadScheduler x:Name="scheduler" AppointmentsSource="{Binding Appointments}"> 
        <telerik:RadScheduler.TimeMarkersSource> 
            <telerik:TimeMarkerCollection> 
                <telerik:TimeMarker TimeMarkerName="Busy" TimeMarkerBrush="Red"  /> 
                <telerik:TimeMarker TimeMarkerName="Free" TimeMarkerBrush="Green" /> 
            </telerik:TimeMarkerCollection> 
        </telerik:RadScheduler.TimeMarkersSource> 
            <telerik:RadScheduler.ViewDefinitions> 
        <telerik:DayViewDefinition /> 
    </telerik:RadScheduler.ViewDefinitions>      
</telerik:RadScheduler> 
or create them in code.

Example 2

public class MyViewModel : ViewModelBase 
{ 
    public BindableCollection<Appointment> Appointments { get; set; } 
    public BindableCollection<TimeMarker> TimeMarkers { get; set; } 
 
    public MyViewModel() 
    { 
        this.Appointments = new BindableCollection<Appointment>(); 
        this.TimeMarkers = new BindableCollection<TimeMarker>() { 
            new TimeMarker("Busy", new SolidColorBrush( Colors.Red ) ), 
            new TimeMarker("Free", new SolidColorBrush( Colors.Green ) ) 
        }; 
    } 
} 

Example 3

<telerik:RadScheduler x:Name="scheduler"  
            AppointmentsSource="{Binding Appointments}" 
            TimeMarkersSource="{Binding TimeMarkers}">       
            <telerik:RadScheduler.ViewDefinitions> 
        <telerik:DayViewDefinition /> 
    </telerik:RadScheduler.ViewDefinitions>      
</telerik:RadScheduler> 
Finally, set the DataContext:

Example 4

this.DataContext = new MyViewModel(); 

See Also

In this article
Not finding the help you need?