Scrolling to Work Time in Timeline View

4 posts, 0 answers
  1. Clyde
    Clyde avatar
    5 posts
    Member since:
    Nov 2012

    Posted 11 Apr 2013 Link to this post


    I am trying to get the scheduler to automatically scroll to the beginning of the scheduler's start work when in timeline view and scaling is set to an hour or less.

    The potential solutions I have found are for the day view. They include:

    Using ScrollToWorkHours()

    Dim sdve As SchedulerDayViewElement = rs.SchedulerElement.ViewElement

    Setting AutoScrollToWorkTime

    TryCast(rs.ActiveView, SchedulerDayViewBase).AutoScrollToWorkTime = True

    Or manually scrolling to a time

    Dim sdve As SchedulerDayViewElement = TryCast(rs.SchedulerElement.ViewElement, SchedulerDayViewElement)
    If sdve IsNot Nothing Then
      sdve.DataAreaElement.Table.ScrollToTime(New TimeSpan(DateTime.Now.Hour, 0, 0))
    End If

    I am unable to get adapt these for the timeline view. Any ideas on how this can be done? 

    Thank you very much. 

  2. Clyde
    Clyde avatar
    5 posts
    Member since:
    Nov 2012

    Posted 15 Apr 2013 Link to this post

    Turns out this is embarrassingly easy!

    'get currently selected date
    Dim t As DateTime() = SchedulerUIHelper.GetSelectedDates(rs)
    Dim lst As List(Of DateTime) = New List(Of DateTime)(t)
    d = lst(0)
    'add number of hours
    rs.GetTimelineView.StartDate = d.Date.AddHours(+7)
  3. Anton
    Anton avatar
    167 posts

    Posted 16 Apr 2013 Link to this post

    Hello Clyde,

    Thank you for writing.

    You cannot adapt these examples to timeline view, because the timeline view is not designed to support WorkTime. In order to use WorkTime you should use SchedulerDayView, SchedulerWeekView, SchedulerMultiDayView or SchedulerWeekView because only these views inherit SchedulerDayViewBase that contains the implementation about it.

    You can read more about the difference between the views in our online documentation:

    However, by setting the StartDate and EndDate property you can limit RadScheduler to show only the working hours. So you can use these properties to implement the desired logic for working hours.

    I hope this information helps. If you have further questions, feel free to write back.

    All the best,
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  4. Clyde
    Clyde avatar
    5 posts
    Member since:
    Nov 2012

    Posted 16 Apr 2013 Link to this post

    Thanks for coming back to me. 

    Indeed, I came to same conclusion and have implemented as such. 
Back to Top