Check if appointment intersects with other appointment

2 posts, 0 answers
  1. AMF
    AMF avatar
    36 posts
    Member since:
    Mar 2011

    Posted 28 Nov 2012 Link to this post

    Hi all,

    How can I check if an appointment intersects with an other appointment?

    I'm using the radscheduler for a planning tool. I'm using recurring appointments to determent the work scheduler for the employees. 
    But I can't figure out how to check if the appointments intersects with the recurrencerule of the appointments.

    I also would like to know how I can add an appointment for every resource. This specifically for the holydays (Christmas for instance)


  2. Ivan Todorov
    Ivan Todorov avatar
    688 posts

    Posted 30 Nov 2012 Link to this post


    Thank you for your question.

    To check if appointments intersect, you should compare their StartDate and EndDate properties. In the case of recurring appointments, you should get their occurrences by using either of the following approaches:
    // iterate all appointment occurrances
    foreach (IEvent ev in recurringAppointment.Occurrences)
    // iterate only occurrences in a given date interval
    IEnumerable<IEvent> occurrences = recurringAppointment.GetOccurrences(
     new DateTime(2008, 10, 1, 10, 0, 0), DateTime.Now);
    foreach (IEvent ev in occurrences)

    You might also need to iterate through the Exceptions collection of the recurring appointments because the occurrence enumerators do not iterate the exceptions:
    foreach (IEvent ev in recurringAppointment.Exceptions)

    More information about recurring appointments can be found in our online documentation.

    Hope you find this useful. Feel free to ask if you have any additional questions.

    Ivan Todorov
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Back to Top