Timeline Views - Limit visible hours

6 posts, 0 answers
  1. Martin Gartmann
    Martin Gartmann avatar
    51 posts
    Member since:
    Apr 2004

    Posted 26 Aug 2011 Link to this post

    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
  2. Martin Gartmann
    Martin Gartmann avatar
    51 posts
    Member since:
    Apr 2004

    Posted 27 Aug 2011 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Richard
    Richard avatar
    2 posts
    Member since:
    Aug 2011

    Posted 27 Aug 2011 Link to this post

    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
  5. Martin Gartmann
    Martin Gartmann avatar
    51 posts
    Member since:
    Apr 2004

    Posted 28 Aug 2011 Link to this post

    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
  6. Richard
    Richard avatar
    2 posts
    Member since:
    Aug 2011

    Posted 30 Aug 2011 Link to this post

    It helps. Thanks a lot. :)
  7. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 31 Aug 2011 Link to this post

    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 >>

Back to Top
UI for WinForms is Visual Studio 2017 Ready