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
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 Object, ByVal e As AppointmentsDraggingEventArgs) Handles 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.
Sorry, the code I pasted above didn't format correctly. Here it is:
Private Sub udvSchedule_AppointmentsDragging(ByVal sender As Object, ByVal e As AppointmentsDraggingEventArgs) Handles udvSchedule.AppointmentsDragging 'For i As Integer = 0 To uciMain.Appointments.Count - 13 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 'For i = 0 To appointmentsInRange.Count - 1 ' e.Appointments(i).StartDateTime = IIf(i = 1, appointmentsInRange(appointmentsInRange.Count - 1).EndDateTime, ) 'Next End If 'Next End Sub