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
Hello Melissa,
medwards11 said:Is there a setting on the CalendarInfo or UltraDayView that would prevent more than one appointment from appearing within the same timeslot?
Maybe one possible approach could be if you are using the code below:
private void ultraCalendarInfo1_BeforeAppointmentAdded(object sender, CancelableAppointmentEventArgs e) { if (ultraCalendarInfo1.GetAppointmentsInRange(e.Appointment.StartDateTime, e.Appointment.EndDateTime).Count > 0) { e.Cancel = true; MessageBox.Show("There are conflict with another appointment in your Calendar"); } }
private void ultraCalendarInfo1_BeforeAppointmentAdded(object sender, CancelableAppointmentEventArgs e)
{
if (ultraCalendarInfo1.GetAppointmentsInRange(e.Appointment.StartDateTime, e.Appointment.EndDateTime).Count > 0)
e.Cancel = true;
MessageBox.Show("There are conflict with another appointment in your Calendar");
}
Let me know if you have any questions.
Regards
Hi Georgi
I tried your code but it doesn't work because it finds appointments across the entire range of owners.
How would I test for appoints overlapping on only the owner in which the new appointment is being added?
Regds
Paul