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
  • 53790
    Suggested Answer
    posted

    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");

        }

    }

    Let me know if you have any questions.

    Regards

Reply Children
No Data