This is a migrated thread and some comments may be shown as answers.

Scrolling to Work Time in Timeline View

3 Answers 197 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Clyde
Top achievements
Rank 2
Clyde asked on 11 Apr 2013, 09:29 AM
Hi, 

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
sdve.DataAreaElement.Table.ScrollToWorkHours()

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. 

Clyde

3 Answers, 1 is accepted

Sort by
0
Clyde
Top achievements
Rank 2
answered on 15 Apr 2013, 12:57 PM
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)
lst.Sort()
d = lst(0)
  
'add number of hours
rs.GetTimelineView.StartDate = d.Date.AddHours(+7)
0
Anton
Telerik team
answered on 16 Apr 2013, 11:04 AM
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: http://www.telerik.com/help/winforms/scheduler-views-overview-and-structure.html

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,
Anton
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Clyde
Top achievements
Rank 2
answered on 16 Apr 2013, 11:07 AM
Thanks for coming back to me. 

Indeed, I came to same conclusion and have implemented as such. 
Tags
Scheduler and Reminder
Asked by
Clyde
Top achievements
Rank 2
Answers by
Clyde
Top achievements
Rank 2
Anton
Telerik team
Share this question
or