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

Timeline Views - Limit visible hours

5 Answers 183 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Martin Gartmann
Top achievements
Rank 2
Martin Gartmann asked on 26 Aug 2011, 05:06 PM
Hi,

currently i use the following code
Me.rsTracks.GetTimelineView.GroupSeparatorWidth = 1
Me.rsTracks.GetTimelineView.ResourcesPerView = 4
Me.rsTracks.GetTimelineView().ShowTimescale(Timescales.Hours)
Dim timescale As SchedulerTimescale = Me.rsTracks.GetTimelineView().GetScaling()
timescale.DisplayedCellsCount = CInt(12)

This will show me the first 12 hours from a defined day. It always starts at 00:00 of a given day.

Any method avaible to move the first visible cell on left hand of the timeline view to any other time ?

In best case i want to see working hours currently declared for the day, for example

15:00 - 23:00 working time  (timescale.Displayed.CellsCount = 8) 

I am quit sure there is a method avaible, because i can use the navigator to move hour by hours, but i was not able to find it.

Any help is welcome.

Kind regards

Martin gartmann

5 Answers, 1 is accepted

Sort by
0
Martin Gartmann
Top achievements
Rank 2
answered on 27 Aug 2011, 09:39 AM
Hi again,

i found a solution for my issue.

Me.rsTracks.GetTimelineView.GroupSeparatorWidth = 2
Me.rsTracks.GetTimelineView.ResourcesPerView = 4
Me.rsTracks.GetTimelineView().ShowTimescale(Timescales.Hours)
Dim timelineView As SchedulerTimelineView = Me.rsTracks.GetTimelineView()
timelineView.StartDate = Me.rcBahnen.SelectedDate.AddHours(My.Settings.wtStart)
Dim timescale As SchedulerTimescale = Me.rsTracks.GetTimelineView().GetScaling()
timescale.DisplayedCellsCount = My.Settings.wtEnd - My.Settings.wtStart

What i did is, that i get the current selected date from a calendar control, that normally set's the startdate for the active view like

  Me.rsTracks.ActiveView.StartDate = Me.rcBahnen.SelectedDate

and to this date i add the hours from my working time.

To give my customers the possibility to set the worktime for their needs this values (Start/End) are stored into application setting and can be changed by the enduser.

Hopefully this code will help other forum user

Kind regards

Martin Gartmann
0
Richard
Top achievements
Rank 1
answered on 28 Aug 2011, 03:19 AM
Good Day,

I want to ask on how to change the time on the scheduler ruler.

Example:
6am
7am
8am
..........
10pm

instead of
12am
11am
10am
........
11pm

Thanks so much,
Richard
0
Martin Gartmann
Top achievements
Rank 2
answered on 28 Aug 2011, 08:50 AM
Hi Richard,

i am not 100 % sure if i understand you corrently.

I am working on a 24 hour timscale (German UI) an i use this routine to set the working hours.
Private Sub SetWorkingHours()
 
      Dim istart, iend As Integer
      istart = My.Settings.wtStart
      iend = My.Settings.wtEnd
 
      Dim interval As New TimeSpan(istart, 0, 0)
      Dim interval2 As New TimeSpan(iend, 0, 0)
 
      Dim timeInterval As New TimeInterval(interval, interval2)
      CType(Me.rsTracks.ActiveView, SchedulerDayViewBase).WorkTime = timeInterval
 
      rsTracks.GetDayView.RulerStartScale = istart
      rsTracks.GetDayView.RulerEndScale = iend
 
  End Sub

.Worktime will set the range you can give a different properties like background color to seperate then visual from others times.

.RulerStartScale and .RulerEndScale set the outer scroll end for you time ruler in dayview.

I don't know if it is possible to change the direction of the ruler from ascending (00:00 to 23:59) to descending (23:59 - 00:00).

Please make more clear what kind of ruler you want.

Kind regards

Martin
0
Richard
Top achievements
Rank 1
answered on 31 Aug 2011, 03:04 AM
It helps. Thanks a lot. :)
0
Ivan Todorov
Telerik team
answered on 31 Aug 2011, 01:52 PM
Hi all,

Thank you Martin, for the community effort. I can confirm that your approach is correct. I have updated your Telerik points for your time and effort.

All the best,
Ivan Todorov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Scheduler and Reminder
Asked by
Martin Gartmann
Top achievements
Rank 2
Answers by
Martin Gartmann
Top achievements
Rank 2
Richard
Top achievements
Rank 1
Ivan Todorov
Telerik team
Share this question
or