Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
How I can improve performance of modifying owner' appearance property?
posted

Hi, I bind a calendarInfo with a dataset and it works. This calendarInfo offers information to UltraMonthViewMulti for selecting activeday, to UltraWeekView, Ultra

UltraMonthViewSingle, UltraWeekView, UltraDayView and UltraTimelineView for showing the schedules of multiple owners.

In the Windows Form, user can choice one of the Views for getting information of schedules.

When user choices UltraTimelineView, all owners’ schedules are shown with default backcolor.

And when user choices other View, each owners’ schedules are shown with specific backcolor by owner.

What I say backcolor is following properties:

- DayAppearance.BackColor

- AlternateMonthDayAppearance.BackColor

- WorkingHourTimeSlotAppearance.BackColor

- WorkingHourTimeSlotAppearance.BorderColor

- NonWorkingHourTimeSlotAppearance.BackColor

- NonWorkingHourTimeSlotAppearance.BorderColor

For realizing this function, I user the following code:

for (var i = 0; i < ultraCalendarInfo1.VisibleOwners.Count; i++)
{
    if (i % 4 == 0)
        continue; // By Default Color

    var owner = ultraCalendarInfo1.VisibleOwners[i];
    if (isNotTimelineView)
    {
        var color = CalenderColors[i % 4 - 1];
        owner.DayAppearance.BackColor = color.Light;
        owner.AlternateMonthDayAppearance.BackColor = color.Dark;
        owner.WorkingHourTimeSlotAppearance.BackColor = color.Light;
        owner.WorkingHourTimeSlotAppearance.BorderColor = color.Border;
        owner.NonWorkingHourTimeSlotAppearance.BackColor = color.Dark;
        owner.NonWorkingHourTimeSlotAppearance.BorderColor = color.Border;
    }
    else
    {
        owner.DayAppearance.Reset();
        owner.AlternateMonthDayAppearance.Reset();
        owner.WorkingHourTimeSlotAppearance.Reset();
        owner.NonWorkingHourTimeSlotAppearance.Reset();
    }
}

This works correctly, but the problem is performance.

I tried this with 250 owners and their 800 appointments, and it needs around 1 sec in Debug Mode of Visual Studio 2017, when I change the selection of view control between UltraTimelineView and others.

I tried SuspendLayout(ResumeLayout) / BeginUpdate(EndUpdate) / Visible:false(Visible:true) for all View, but nothing better.(UltraCalendarInfo component doesn’t have these method)

Any help would be much appreciated.

Parents
No Data
Reply
  • 34430
    Verified Answer
    Offline posted

    Hello Keiji,

    I have been discussing this performance issue that you are seeing with my colleagues, and it is worth noting that the UltraTimelineView and the “WinSchedule” family of controls were designed and tested against a handful of owners in this case. 250 owners seems like quite a lot to have in a single schedule control, and so the approximate 1 second performance delay that you are seeing in Debug mode of Visual Studio 2017 is likely expected in this case, as the changes to the appearances of your owners needs to filter down into the schedule control for each owner.

    It may be possible that we can make improvements in this area, though, but I would need a sample that shows this performance hit so that I could profile it and discover where this is actually coming from. Would it be possible for you to please provide an isolated sample project that demonstrates this performance issue that you are seeing?

    Please let me know if you have any other questions or concerns on this matter.

Children
No Data