TimelineView hours scale, setting the start hour of the day

2 posts, 0 answers
  1. Pirjo
    Pirjo avatar
    10 posts
    Member since:
    Mar 2013

    Posted 17 Feb 2015 Link to this post


    I'm using the timelineview with Timescales.Hours. I would like to set the view so that the first hour displayed in the left side would be the one that has the first appointment of the day.

    How can I achieve this in the code (vb.net)?

    a) I know that I can set the start date, but can I set the start hour somehow? If I know, for example, that the first appointment is at 14:15, can I set the start hour to 14:00?

    b) Or can I scroll to the first appointment of the day, so that the first appointment would be displayed in the left side of the view?

    I'm using Telerik UI for Winforms Q3 2014 SP1

  2. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    3532 posts

    Posted 18 Feb 2015 Link to this post

    Hello Pirjo,

    Thank you for writing.

    You can set the SchedulerTimelineView.StartDate property specifying the time part as well. Here is a sample code snippet which result is illustrated on the attached screenshot.
    Sub New()
        Me.RadScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Timeline
        Dim timelineView As SchedulerTimelineView = Me.RadScheduler1.GetTimelineView()
        Dim scale As Timescales = Timescales.Hours
        timelineView.StartDate = New Date(2015, 2, 22, 14, 0, 0)
    End Sub

    In order to navigate the SchedulerTimelineView to a specific DateTime, you can use the SchedulerTimelineView.GetViewContainingDate method:
    Dim timelineView As SchedulerTimelineView = Me.RadScheduler1.GetTimelineView()
    Me.RadScheduler1.ActiveView = timelineView.GetViewContainingDate(New DateTime(2015, 3, 29, 15, 0, 0))

    I hope this information helps. Should you have further questions, I would be glad to help.

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top