This is a migrated thread and some comments may be shown as answers.

is it possible intersect appointment move simultaneously

1 Answer 79 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
rajesh
Top achievements
Rank 1
rajesh asked on 10 Jan 2012, 06:11 AM

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?

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 12 Jan 2012, 04:24 PM
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
                .OfType<IAppointment>()
                .Where(a => this.AreOverlapping(a, sl) && !state.DraggedAppointments.Contains(a)));
    base.Drop(state);
}

and AreOverlapping and AreIntersected methods are defined like this:

private static bool AreIntersected(IEnumerable<IResource> first, IEnumerable<IResource> other)
{
    IEnumerable<IResource> firstResources = first
        .Distinct();
 
    IEnumerable<IResource> otherResources = other
        .Distinct();
 
    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,
Yana
the Telerik team

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

Tags
ScheduleView
Asked by
rajesh
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or