is it possible intersect appointment move simultaneously

2 posts, 0 answers
  1. rajesh
    rajesh avatar
    2 posts
    Member since:
    Sep 2012

    Posted 10 Jan 2012 Link to this post

    while we move one appointment, it may overlap other one, instead of overlapping we need to move that also synchronised with initial one. is this feature available in  schedule view?

  2. Yana
    Yana avatar
    4604 posts

    Posted 12 Jan 2012 Link to this post

    Hello Rajesh,

    RadScheduleView doesn't support such functionality out of the box.   You can try to implement it with a custom DragDropBehavior. More information about it can be found here.

    You can find the existing appointments in Drop method like this:

    public override void Drop(Telerik.Windows.Controls.DragDropState state)
        var res = state.DestinationSlots.SelectMany(sl => state.DestinationAppointmentsSource
                    .Where(a => this.AreOverlapping(a, sl) && !state.DraggedAppointments.Contains(a)));

    and AreOverlapping and AreIntersected methods are defined like this:

    private static bool AreIntersected(IEnumerable<IResource> first, IEnumerable<IResource> other)
        IEnumerable<IResource> firstResources = first
        IEnumerable<IResource> otherResources = other
        return firstResources.Where((IResource r) => otherResources.Contains(r)).Count() == firstResources.Count();
    private bool AreOverlapping(IAppointment appointment, Slot slot)
        return appointment.IntersectsWith(slot) && AreIntersected(appointment.Resources.OfType<IResource>(), slot.Resources.OfType<IResource>());

    Please try it and if you have any difficulties, write to us again.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top