Hi,
Is there anything like this for the Winform Scheduler:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/limitconcurrentappointments/defaultcs.aspx
I still want to keep all the functionality ie drag and drop, resize etc I just want to check that no appointments overlap.
I can't see anything in the winform demo
Thanks
Is there anything like this for the Winform Scheduler:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/limitconcurrentappointments/defaultcs.aspx
I still want to keep all the functionality ie drag and drop, resize etc I just want to check that no appointments overlap.
I can't see anything in the winform demo
Thanks
3 Answers, 1 is accepted
0
Hello Karl,
Thank you for your question.
This functionality is not support out of the box, but you can achieve this by utilizing some of RadScheduler's events. The following code snippet demonstrates this:
I hope this is useful. Should you have any further questions, we will be glad to address them.
Regards,
Ivan Todorov
the Telerik team
Thank you for your question.
This functionality is not support out of the box, but you can achieve this by utilizing some of RadScheduler's events. The following code snippet demonstrates this:
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
this
.radScheduler1.Appointments.CollectionChanging +=
new
NotifyCollectionChangingEventHandler(Appointments_CollectionChanging);
}
void
Appointments_CollectionChanging(
object
sender, NotifyCollectionChangingEventArgs e)
{
if
(e.Action == NotifyCollectionChangedAction.Add)
{
e.Cancel =
this
.IsIntersecting(e.NewItems[0]
as
IEvent);
}
}
private
bool
IsIntersecting(IEvent newApp)
{
if
(newApp ==
null
)
{
return
false
;
}
foreach
(IEvent app
in
this
.radScheduler1.Appointments)
{
if
(newApp.Start < app.End && newApp.End > app.Start)
{
return
true
;
}
}
return
false
;
}
}
I hope this is useful. Should you have any further questions, we will be glad to address them.
Regards,
Ivan Todorov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
Karl
Top achievements
Rank 1
answered on 05 Mar 2012, 02:39 PM
Hi,
The Appointments_CollectionChanging does not seem to fire, I looked a little more and it says it won't fire if I have not implemented INotifyPropertyChanging, I followed the customeditappointmentdialog example for my project.
But it still won't fire.
Any ideas?
Thanks
The Appointments_CollectionChanging does not seem to fire, I looked a little more and it says it won't fire if I have not implemented INotifyPropertyChanging, I followed the customeditappointmentdialog example for my project.
public
class TimeAppointment : Appointment
{
}
and then added this to implement it
public
class
TimeAppointment : Appointment, INotifyPropertyChanged
{
public
event
PropertyChangedEventHandler PropertyChanged;
protected
override
void
OnPropertyChanged(
string
propertyName)
{
if
(
this
.PropertyChanged !=
null
)
{
this
.PropertyChanged(
this
,
new
PropertyChangedEventArgs(propertyName));
}
}
}
But it still won't fire.
Any ideas?
Thanks
0
Hello Karl,
You do not need to implement the mentioned interface when using the CollectionChaning event. It should fire properly when adding new appointments. However, to check if the appointments overlap when dragging or resizing them, you should use the AppointmentMoving and AppointmentResizing events. I have skipped this requirement in my previous post by mistake. Now I am sending you a small sample project which demonstrates how to implement the desired scenario.
Please let me know if it works for you. Also, if you have any further questions, feel free to ask.
Kind regards,
Ivan Todorov
the Telerik team
You do not need to implement the mentioned interface when using the CollectionChaning event. It should fire properly when adding new appointments. However, to check if the appointments overlap when dragging or resizing them, you should use the AppointmentMoving and AppointmentResizing events. I have skipped this requirement in my previous post by mistake. Now I am sending you a small sample project which demonstrates how to implement the desired scenario.
Please let me know if it works for you. Also, if you have any further questions, feel free to ask.
Kind regards,
Ivan Todorov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>