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

How do I Set FirstVisibleTime on DayView and WeekView Definitions

Environment

Product Version 2019.2.618
Product RadScheduleView for WPF

Description

How to change the FirstVisibleTime of RadScheduleView when the active view definition gets changed.

Solution

Create a custom control that derives from RadScheduleView and override the OnActiveViewDefinitionChanged. Then reset the FirstVisibleTime property.

public class CustomScheduleView : RadScheduleView 
{ 
    protected override void OnActiveViewDefinitionChanged(ViewDefinitionBase oldValue, ViewDefinitionBase newValue) 
    { 
        base.OnActiveViewDefinitionChanged(oldValue, newValue); 
 
        // reset the first visible time 
        var time = this.FirstVisibleTime; 
        this.FirstVisibleTime = TimeSpan.Zero; 
        this.FirstVisibleTime = time; 
    } 
} 
In this article