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
1015
Preventing overlapping appointments in the same time slot
posted

Hello all,

I'm working with an v11.2 UltraDayView that allows the user to schedule appointments based on "tasks". Eventually, we'd like to be able to pull back the user's laid-out schedule and create a report based on where they spend their time. For our purposes, it doesn't make much sense to have multiple appointments displaying in the same time slot. Is there a setting on the CalendarInfo or UltraDayView that would prevent more than one appointment from appearing within the same timeslot?

Based on another post, I tried using the GetAppointmentsInRange() method to return the appointments involved with the dragging/rearranging to check against, but I haven't been able to get the logic working like I need it to.

Any suggestions, comments, or ideas are appreciated.

Thanks!

Melissa

Parents
No Data
Reply
  • 1015
    posted

    I'm still waiting for any input on this question. Here's what I've gotten so far:

            Private Sub udvSchedule_AppointmentsDragging(ByVal sender As ObjectByVal e As AppointmentsDraggingEventArgsHandles udvSchedule.AppointmentsDragging
                Dim dragStartDate = (From a In e.Appointments
                                     Order By a.StartDateTime Ascending
                                     Select a.StartDateTime).First
                Dim dragEndDate = (From a In e.Appointments
                                   Order By a.EndDateTime Descending
                                   Select a.EndDateTime).First
     
                Dim appointmentsInRange = udvSchedule.CalendarInfo.GetAppointmentsInRange(dragStartDate, dragEndDate)
     
                If appointmentsInRange.Count > 1 Then
                    e.Appointments(0).StartDateTime = appointmentsInRange(1).EndDateTime
                End If
            End Sub

    Right now, despite the code above, if I drag an appointment onto a timeslot that already contains another appointment, it will still place them side by side.

     

Children