Completed
Last Updated: 30 Oct 2020 17:05 by ADMIN
Release R1 2021 (LIB 2020.3.1102)
CHEE HANG
Created on: 21 Oct 2020 14:37
Category: Scheduler/Reminder
Type: Bug Report
0
RadScheduler: appointments are placed in the wrong cell when the ActiveView.StartDate is changed

Here is the code snippet:

    Sub New()

        InitializeComponent()

        Dim culture As CultureInfo = New CultureInfo("en-US")
        culture.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Monday
        culture.DateTimeFormat.CalendarWeekRule = CalendarWeekRule.FirstFourDayWeek
        Me.RadScheduler1.Culture = culture

        Me.RadScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Timeline
        Dim timelineView As SchedulerTimelineView = Me.RadScheduler1.GetTimelineView()
        Dim scale As Timescales = Timescales.Weeks
        timelineView.ShowTimescale(scale) 

    End Sub
 

    Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim baseDate As DateTime = DateTime.Today
        Dim start As DateTime() = New DateTime() {baseDate.AddHours(14.0), baseDate.AddDays(1.0).AddHours(9.0), baseDate.AddDays(2.0).AddHours(13.0)}
        Dim [end] As DateTime() = New DateTime() {baseDate.AddHours(16.0), baseDate.AddDays(1.0).AddHours(15.0), baseDate.AddDays(2.0).AddHours(17.0)}



        Dim appointment As Appointment = Nothing
        For i As Integer = 0 To 2
            appointment = New Appointment(start(i), [end](i), "A" & i, "D" & i, "L" & i) 
            Me.RadScheduler1.Appointments.Add(appointment)
        Next

        Me.RadScheduler1.ActiveView.StartDate = New DateTime(2020, 10, 11)
    End Sub

You will notice that if the StartDate is changed the appointments occupy the wrong cells until you scroll horizontally and the view is updated.

1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 21 Oct 2020 14:43

Hello,

The possible solution that can work for this case is simulating the horizontal scrolling after managing the StartDate:

        Dim view As SchedulerTimelineViewElement = TryCast(Me.RadScheduler1.ViewElement, SchedulerTimelineViewElement)
        view.NavigationElement.Value += view.NavigationElement.SmallChange
        view.NavigationElement.Value -= view.NavigationElement.SmallChange

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).