Approved
Last Updated: 21 Nov 2016 12:38 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 15 Nov 2016 09:07
Category: Scheduler/Reminder
Type: Bug Report
1
FIX. RadScheduler - work time is not correctly displayed when modifying the RulerPrimitive's Start/EndScale
To reproduce: use the following code

Sub New()

    InitializeComponent()

    AddHandler Me.RadScheduler1.ActiveViewChanged, AddressOf ActiveViewChanged
    Me.RadScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Week
End Sub

Private Sub ActiveViewChanged(sender As Object, e As Telerik.WinControls.UI.SchedulerViewChangedEventArgs)
    Dim dayView As SchedulerDayViewBase = TryCast(Me.RadScheduler1.ActiveView, SchedulerDayViewBase)
    Dim dayViewElement As SchedulerDayViewElement = TryCast(Me.RadScheduler1.SchedulerElement.ViewElement, SchedulerDayViewElement)
    If dayViewElement IsNot Nothing Then
        Dim ruler As RulerPrimitive = dayViewElement.DataAreaElement.Ruler
        ruler.StartScale = 6
        ruler.EndScale = 22  
        dayView.WorkTime = New TimeInterval(TimeSpan.FromHours(13), TimeSpan.FromHours(16))
         
    End If
End Sub

When you run the project you will notice that the work time starts from 19:00 to 22:00. When you switch between DayView and WeekView, the ruler is not aligned with the scheduler cells as well. The attached gif file illustrates the incorrect behavior.

Workaround: use the RulerStartScale and RulerEndScale of the SchedulerDayViewBase

 Sub New()

     InitializeComponent()

     AddHandler Me.RadScheduler1.ActiveViewChanged, AddressOf ActiveViewChanged
     Me.RadScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Week
 End Sub

 Private Sub ActiveViewChanged(sender As Object, e As Telerik.WinControls.UI.SchedulerViewChangedEventArgs)
     Dim dayView As SchedulerDayViewBase = TryCast(Me.RadScheduler1.ActiveView, SchedulerDayViewBase)
     If dayView IsNot Nothing Then
         dayView.RulerStartScale = 6
         dayView.RulerEndScale = 22
         dayView.WorkTime = New TimeInterval(TimeSpan.FromHours(13), TimeSpan.FromHours(16))
     End If
 End Sub

Attached Files:
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments