RadScheduler datasource, update is slow.

2 posts, 0 answers
  1. Jill-Connie Lorentsen
    Jill-Connie Lorentsen avatar
    118 posts
    Member since:
    Nov 2008

    Posted 23 Jun 2014 Link to this post

    I have a RadScheduler with a datasource initated like this:

    private void InitiateBookingDataSource()
                if (_appointmentBookings == null) _appointmentBookings = new BindingList<Booking>();
                var dataSource = new SchedulerBindingDataSource();
                var mappingInfo = new AppointmentMappingInfo
                                          Start = "StartTime",
                                          End = "EndTime",
                                          Summary = "BookingSubject",
                                          Description = "BookingDescription",
                                          BackgroundId = "BackgroundId",
                                          AllDay = "AllDay",
                                          RecurrenceRule = "RecurrenceRule",
                                          Exceptions = "Exceptions",
                                          MasterEventId = "MasterEventId",
                                          Visible = "Visible"
                mappingInfo.Mappings.Add(new SchedulerMapping("CaseId", "CaseId"));
                mappingInfo.Mappings.Add(new SchedulerMapping("PratId", "PratId"));
                mappingInfo.Mappings.Add(new SchedulerMapping("BoothId", "BoothId"));
                mappingInfo.Mappings.Add(new SchedulerMapping("CaseDesc", "CaseDesc"));
                mappingInfo.Mappings.Add(new SchedulerMapping("BoothDesc", "BoothDesc"));
                dataSource.EventProvider.Mapping = mappingInfo;
                dataSource.EventProvider.DataSource = _appointmentBookings;
                dataSource.EventProvider.AppointmentFactory = rsBookings.AppointmentFactory;
                rsBookings.DataSource = dataSource;

    The appointments are initiated and updated by calling the method below. The problem is that it takes "forever" if the number of appointments exceeds approx 50. Is there a way to speed it up? I have tried async await, but as I am new to that procedure I haven't been able to implement it successfully.

    Regards, Jill-Connie Lorentsen
    private void InitiateAppointments(IEnumerable<Booking> bookings)
                   if (_appointmentBookings == null) _appointmentBookings = new BindingList<Booking>();
                   foreach (var booking in bookings)
                       var appointment = booking;
                       appointment.BackgroundId = _booths.Find(b => b.BoothId == booking.BoothId).BackgroundId;
                       appointment.Exceptions.ForEach(b => b.BackgroundId = _booths.Find(x => x.BoothId == b.BoothId).BackgroundId);
               catch (Exception ex)
  2. George
    George avatar
    500 posts

    Posted 26 Jun 2014 Link to this post

    Hi Jill,

    Thank you for contacting us.

    Since the problem occurs in the InitiateAppointments method my guess is that the collections you are iterating are quite large. I see that you are iterating the bookings collection, then for each booking you iterate the _booths and then for each exception in each appointment also iterate the _booths collection. All of these operations are with linear complexity which can be slow with large collections. I would recommend you to try to optimize that method. You can also provide me with more details about your case and the collections at hand. Possibly with a sample project which I can investigate locally.

    Looking forward to your response.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top