0

First of all, I know, that Janusys components already died and there is no official support anymore.

But, maybe someone has an idea, of how I can resolve this issue. I use the lates available build 4.0.51 (WinForms)

I use the following code to add appointments to my scheduler:

            RemoveHandler Me.Scheduler.AppointmentAdded, AddressOf Me.Schedule_AppointmentAdded
            RemoveHandler Me.Scheduler.Reminder, AddressOf Me.Schedule_Reminder
            RemoveHandler Me.Scheduler.AppointmentChanged, AddressOf Me.Schedule_AppointmentChanged
            RemoveHandler Me.Scheduler.DoubleClick, AddressOf Me.Schedule_DoubleClick
            RemoveHandler Me.Scheduler.AppointmentDoubleClick, AddressOf Me.Schedule_AppointmentDoubleClick

            Dim locCountOfAppontments = locAppointments.Count
            Dim locCurrentAppointmentIndex = 0
            Dim locMyDays = Scheduler.DayColumns

            Me.Scheduler.Enabled = False

            locAppointments.ForEach(Sub(appointment)
                                        Dim locNewScheduleAppointment = New ScheduleAppointment(appointment.StartOfAppointment,
                                                                                            appointment.EndOfAppointment,
                                                                                            appointment.Title)

                                        locNewScheduleAppointment.Key = appointment.Id
                                        locNewScheduleAppointment.Description = appointment.LongText
                                        locNewScheduleAppointment.Owner = Int64.Parse(appointment.EmployeeId)
                                        locNewScheduleAppointment.Reminder.Enabled = If(appointment.Reminder.HasValue, appointment.Reminder.Value, True)
                                        If String.IsNullOrEmpty(appointment.Layout) = False Then
                                            locNewScheduleAppointment.SettingsInfo = appointment.Layout
                                        End If
                                        If String.IsNullOrEmpty(appointment.Recurrency) = False Then
                                            locNewScheduleAppointment.RecurrencePatternInfo = appointment.Recurrency
                                        End If

                                        Me.Scheduler.Appointments.Add(locNewScheduleAppointment)

                                        If IsNothing(appointment.CategoryId) = False Then
                                            locNewScheduleAppointment.SetValue("CategoryId", appointment.CategoryId)
                                        End If

                                        locCurrentAppointmentIndex += 1
                                    End Sub)
            Me.Scheduler.Enabled = True
            Me.CreateFormatConditions()
            Me.FillOwners()

            RaiseEvent ReportAddingAppointmentsFinished()
            Scheduler.DayColumns = locMyDays
            myIsInitalizingData = False
            AddHandler Me.Scheduler.AppointmentAdded, AddressOf Me.Schedule_AppointmentAdded
            AddHandler Me.Scheduler.Reminder, AddressOf Me.Schedule_Reminder
            AddHandler Me.Scheduler.AppointmentChanged, AddressOf Me.Schedule_AppointmentChanged
            AddHandler Me.Scheduler.DoubleClick, AddressOf Me.Schedule_DoubleClick
            AddHandler Me.Scheduler.AppointmentDoubleClick, AddressOf Me.Schedule_AppointmentDoubleClick
            Me.Scheduler.EndEdit()

I have about 500 appointments and almost every appointment has a recurrency pattern, so I have to load all appointments. The problem is, that the add routine is getting slower on each call. The first 20 appointments are added under one second, but at appointment 150, it already needs about a second for a single appointment to get added. What I already tried is to execute the above code in a seperate thread, what is working, but not speeding up the scenario.

The scheduler isn't bound to any calender. The schedular is on a usercontrol.

THX a lot

Zero-G.
  • 45
  • 10
  • It sounds like the scheduler is rendering per add, have you tried suspending the rendering until you've added them all? https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.suspendlayout?view=net-5.0 - there may also be a `Janusys` version of the above built into the control itself. I remember using this once for a project and it did take a little while for the scheduler to render when there was a lot of data (it was fine once it had rendered) – Charleh Dec 07 '20 at 10:45
  • Hey Charleh THX for the tip - I gave it a try, but nothing changes on the speed. – Zero-G. Dec 07 '20 at 11:03
  • Did you check the Janusys forums? You can search them - I've found a few posts on performance, most of them say they were bugs that have been fixed but there are a few others - might be worth running through them. Did you also look at `DatesChanged` event and ensure you filter what you are adding to the scheduler based on the dates there. – Charleh Dec 07 '20 at 11:09
  • Hey THX - Yes, I have been on the forum there, but nothing seems to fit to my problem. I found out, that the problem are the recurrencies. When I don't load them, then all appointments get into the scheduler in less a second. - But when I add the appointments with the recurrency pattern, then it slows down. PS: I don't use the DatesChanged event at all. – Zero-G. Dec 07 '20 at 11:31
  • It sounds like maybe the scheduler is adding the recurring items to the grid (the ones you can't see) which is making it take a long time to render. Problem is, is there anything you can do to mitigate it or are you just going to have to live with the perf issue.. as you said the control is way over 17 years old now and no longer maintained. Are you stuck with it? There are probably other decent scheduler controls that you could use.. – Charleh Dec 07 '20 at 11:57
  • THX a lot fort taking the time Charleh! I can't change it, because my complete Solution depends on that (old) controls (the new version won't). – Zero-G. Dec 07 '20 at 12:23

0 Answers0