Display an indicator at the current time in Day/Week view
ENVIRONMENT
Product | Telerik WebForms Scheduler for ASP.NET AJAX |
DESCRIPTION
In certain scenarios, you may wish to incorporate a horizontal indicator to denote the current time within the Day or Week view of the Scheduler.
SOLUTION
While the Scheduler does not natively support this feature, you can achieve a comparable outcome by utilizing a workaround. Specifically, you can use the TimeSlotCreated
event to apply a CSS class to the current time slot. This method allows for custom styling and functionality to highlight or modify the appearance of the current time slot in the Scheduler.
Example
html body .RadScheduler .nowCss {
border-bottom: 1px solid red;
}
protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
{
if ((e.TimeSlot.End < DateTime.Now.AddMinutes(30)) && (e.TimeSlot.End > DateTime.Now))
{
e.TimeSlot.CssClass = "nowCss";
}
}
Protected Sub RadScheduler1_TimeSlotCreated(ByVal sender As Object, ByVal e As TimeSlotCreatedEventArgs)
If (e.TimeSlot.[End] < DateTime.Now.AddMinutes(30)) AndAlso (e.TimeSlot.[End] > DateTime.Now) Then
e.TimeSlot.CssClass = "nowCss"
End If
End Sub