Completed
Last Updated: 09 Oct 2014 10:28 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 25 Jul 2014 13:12
Category: Scheduler/Reminder
Type: Bug Report
0
FIX. RadScheduler - After changing the GroupType, StartDate/RangeStartDate are reset
To reproduce :
1. Add a RadScheduler and a RadToggleButton.
2. Use the following code snippet:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.RadScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Timeline

    Dim colors As Color() = New Color() {Color.LightBlue, Color.LightGreen, Color.LightYellow, Color.Red, Color.Orange, Color.Pink, _
        Color.Purple, Color.Peru, Color.PowderBlue}

    Dim names As String() = New String() {"Alan Smith", "Anne Dodsworth", "Boyan Mastoni", "Richard Duncan", "Maria Shnaider"}

    For i As Integer = 0 To names.Length - 1
        Dim resource As New Resource()
        resource.Id = New EventId(i)
        resource.Name = names(i)
        resource.Color = colors(i)
        Me.RadScheduler1.Resources.Add(resource)
    Next

    Me.RadScheduler1.ActiveView.ResourcesPerView = 2

    Dim timelineView As SchedulerTimelineView = Me.RadScheduler1.GetTimelineView()
    Dim scale As Timescales = Timescales.Hours
    timelineView.ShowTimescale(scale)
    timelineView.StartDate = DateTime.Now.Date.AddHours(5)
    timelineView.RangeStartDate = DateTime.Now.Date.AddHours(5)
    timelineView.RangeEndDate = DateTime.Now.Date.AddHours(15)
    timelineView.CurrentScale.DisplayedCellsCount = 10
End Sub

Private Sub RadToggleButton1_ToggleStateChanged(sender As Object, args As StateChangedEventArgs) Handles RadToggleButton1.ToggleStateChanged
    If args.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On Then
        Me.RadScheduler1.GroupType = GroupType.Resource
    Else
        Me.RadScheduler1.GroupType = GroupType.None
    End If
End Sub

Initially, the timeline view start from the correct hour (5 AM). However, the horizontal scroll bar allows you to navigate in right direction as the  RangeEndDate is currently visible in the view. When you click the toggle button, the scheduler is grouped by resources and the timeline start is reset.
0 comments