16 Answers, 1 is accepted
0
Accepted
Hi Robert,
The First Look example of RadScheduleView for WPF contains a class named ConflictCheckingDragDropBehavior, where the requested functionality is already implemented. You can see how it works here:
http://demos.telerik.com/wpf/?ScheduleView/FirstLook
The behavior can be further extended to perform additional actions when the appointment is dropped over another appointment - for example to delete the underlying appointments, or ask the user what to do...
Kind regards,
Valeri Hristov
the Telerik team
The First Look example of RadScheduleView for WPF contains a class named ConflictCheckingDragDropBehavior, where the requested functionality is already implemented. You can see how it works here:
http://demos.telerik.com/wpf/?ScheduleView/FirstLook
The behavior can be further extended to perform additional actions when the appointment is dropped over another appointment - for example to delete the underlying appointments, or ask the user what to do...
Kind regards,
Valeri Hristov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Robert
Top achievements
Rank 1
answered on 27 Jan 2011, 05:45 PM
Fantastic! Thanks
0
Daniel
Top achievements
Rank 1
answered on 30 May 2011, 02:29 PM
Is there something like this also for the Silverlight version?
0
Hello Daniel,
The same example is available for Silverlight too:
http://demos.telerik.com/silverlight/#ScheduleView/FirstLook
Best wishes,
Valeri Hristov
the Telerik team
The same example is available for Silverlight too:
http://demos.telerik.com/silverlight/#ScheduleView/FirstLook
Best wishes,
Valeri Hristov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Aziz
Top achievements
Rank 1
answered on 26 Sep 2011, 02:11 PM
you changed your online demo's recently and the new ones no longer have the ConflictCheckingDragDropBehavior.cs for WPF or silverlight, can you please provide these ASAP?
0
Hi Jacob,
Please find ConflictCheckingDragDropBehavior.cs file attached.
All the best,
Yana
the Telerik team
Please find ConflictCheckingDragDropBehavior.cs file attached.
All the best,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Aziz
Top achievements
Rank 1
answered on 05 Oct 2011, 03:14 PM
amazing, thanks so much!
on a related issue is there a way to easily add priority to each appointment so that if two appointments happen at the same time you can set which one has a higher priority and move that appointment to the left of the appointment block?
on a related issue is there a way to easily add priority to each appointment so that if two appointments happen at the same time you can set which one has a higher priority and move that appointment to the left of the appointment block?
0
Hello Jacob,
I'm afraid that this is not possible in RadScheduleView - there is no way to control the appointments' order in the timeslot.
We're sorry for the inconvenience.
Best wishes,
Yana
the Telerik team
I'm afraid that this is not possible in RadScheduleView - there is no way to control the appointments' order in the timeslot.
We're sorry for the inconvenience.
Best wishes,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Patrick
Top achievements
Rank 2
answered on 25 Nov 2011, 11:38 PM
Hi Yana,
It is possible to have a full example in VB please?
Thank you in advance.
Patrick
It is possible to have a full example in VB please?
Thank you in advance.
Patrick
0
Hi Patrick,
I've attached the code in VB.
Greetings,
Yana
the Telerik team
I've attached the code in VB.
Greetings,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Patrick
Top achievements
Rank 2
answered on 29 Nov 2011, 01:02 AM
Hi Yana,
Thank you it's working good.
But with more than one Resources, I can't Resize or Drop my appointment if I already have another appointment (under an orther resources) at the same time.
I want to be able to control the overlapping on the same resource only...Is there a way to do it?
It's look like the appointment.IntersectsWith(slot) don't check the resource in the slot object but only the slot it self...
Thanks in advance!!!!
Thank you it's working good.
But with more than one Resources, I can't Resize or Drop my appointment if I already have another appointment (under an orther resources) at the same time.
I want to be able to control the overlapping on the same resource only...Is there a way to do it?
It's look like the appointment.IntersectsWith(slot) don't check the resource in the slot object but only the slot it self...
Thanks in advance!!!!
Public Class ConflictCheckingDragDropBehavior
Inherits ScheduleViewDragDropBehavior
Public Overloads Overrides Function CanDrop(ByVal state As DragDropState) As Boolean
Return state.DestinationAppointmentsSource.OfType(Of IAppointment)().Where(Function(a As IAppointment) Not state.DraggedAppointments.Contains(a)).All(Function(a As IAppointment) state.DestinationSlots.All(Function(s As Slot) Not Me.AreOverlapping(a, s)))
End Function
Public Overloads Overrides Function CanResize(ByVal state As DragDropState) As Boolean
Return state.DestinationAppointmentsSource.OfType(Of IAppointment)().Where(Function(a As IAppointment) a IsNot state.Appointment).All(Function(a As IAppointment) state.DestinationSlots.All(Function(s As Slot) Not Me.AreOverlapping(a, s)))
End Function
Private Function AreOverlapping(ByVal appointment As IAppointment, ByVal slot As Slot) As Boolean
Return appointment.IntersectsWith(slot)
End Function
End Class
0
Patrick
Top achievements
Rank 2
answered on 29 Nov 2011, 02:20 PM
Hi Yana,
I fix my problem that way....
Thank you
I fix my problem that way....
Private Function AreOverlapping(ByVal appointment As IAppointment, ByVal slot As Slot) As Boolean
If appointment.Resources(0).ToString <> slot.Resources(0).ToString Then
Return False
Else
Return appointment.IntersectsWith(slot)
End If
End Function
Thank you
0
Grant
Top achievements
Rank 1
answered on 14 Dec 2011, 07:34 PM
Hi Yana--it appears that the attached code sample doesn't work well for recurring appointments
Would you have a suggestion or updated sample on how to enable the same scenario with recurring appointments?
Thanks,
Grant
Would you have a suggestion or updated sample on how to enable the same scenario with recurring appointments?
Thanks,
Grant
0
Hi Grant,
Please modify AreOverlapping method in the ConflictCheckingDragDropBehavior like this:
in order to make it work for recurrent appointments.
Hope this helps.
Greetings,
Yana
the Telerik team
Please modify AreOverlapping method in the ConflictCheckingDragDropBehavior like this:
private
bool
AreOverlapping(IAppointment appointment, Slot slot)
{
return
(appointment.IntersectsWith(slot) && AreIntersected(appointment.Resources.OfType<IResource>(), slot.Resources.OfType<IResource>())) ||
(appointment.GetOccurrences(slot.Start, slot.End).Count() > 0 && AreIntersected(appointment.Resources.OfType<IResource>(), slot.Resources.OfType<IResource>()));
}
in order to make it work for recurrent appointments.
Hope this helps.
Greetings,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Julien
Top achievements
Rank 1
answered on 15 May 2013, 06:50 AM
I implemented the ConflictCheckingDragDropBehavior in my application. As expected, I can not overlap appointments. Good !
By cons, since i added this piece of code (see below), I noticed that it was possible to move an appointment in a read only slot, whereas before, it was impossible !
I tried to modify the method CanDrop to handle the IsReadOnly property of the DestinationSlots but, strangely, this one always seems to be false.
Someone you already solved this problem ?
By cons, since i added this piece of code (see below), I noticed that it was possible to move an appointment in a read only slot, whereas before, it was impossible !
public
class
ConflictCheckingDragDropBehavior : ScheduleViewDragDropBehavior
{
public
override
bool
CanDrop(DragDropState state)
{
return
state.DestinationAppointmentsSource
.OfType<IAppointment>()
.Where((IAppointment a) => !state.DraggedAppointments.Contains(a))
.All((IAppointment a) => state.DestinationSlots.All((Slot s) => !
this
.AreOverlapping(a, s)));
}
public
override
bool
CanResize(DragDropState state)
{
return
state.DestinationAppointmentsSource
.OfType<IAppointment>()
.Where((IAppointment a) => a != state.Appointment)
.All((IAppointment a) => state.DestinationSlots.All((Slot s) => !
this
.AreOverlapping(a, s)));
}
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>());
return
appointment.IntersectsWith(slot);
}
}I tried to modify the method CanDrop to handle the IsReadOnly property of the DestinationSlots but, strangely, this one always seems to be false.
Someone you already solved this problem ?
0
Julien
Top achievements
Rank 1
answered on 15 May 2013, 07:02 AM
I solved the problem by changing the CanDrop method like this :
return base.CanDrop(state) && state.DestinationAppointmentsSource
.OfType<
IAppointment
>()
.Where((IAppointment a) => !state.DraggedAppointments.Contains(a))
.All((IAppointment a) => state.DestinationSlots.All((Slot s) => !this.AreOverlapping(a, s)));