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

WPF RadScheduler GetAllAppointments from selected Slot

4 Answers 151 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Sarif
Top achievements
Rank 1
Sarif asked on 17 Sep 2015, 09:57 PM

Hello,

in ASP you have this method:

protected void TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)

where you can use this:

int count = e.TimeSlot.Appointments.Count

Ideal scenario:

1. Press on a Slot >> check Resource.Name + Appointments.Count >> if (Appointments.Count >= 5) >> you cannot add a new appointment in this Slot.

 

Thanks in advanced.

4 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 18 Sep 2015, 08:19 AM
Hello,

This API from ASP.NET RadScheduleView does not have an alternative in RadScheduleview for WPF.

To achieve the desired functionality you can get all appointments for a certain period by using GetOccurrences method. If you loop through the AppointmentsSource of the ScheduleView and call this method for each appointment, you'll get the needed result. After that you will be able to count them and display them where is suitable for you. 

Also I suggest you review one of our SDK example where a similar approach is illustrated.

Regards,
Rosi
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Sarif
Top achievements
Rank 1
answered on 30 Oct 2015, 10:27 AM
Sorry for the late response, but in your SDK example you have a tiny bug. For instance: If you drag-and-drop Appointment - this scenario working fine, no complaints, but if you will try to edit this Appointment - it will overlap another Appointment. How to prevent this? Scenario to recreate: 1. Create 2 Appointments. 2. Edit date/time one of this Appointments so they have some period of time in common. Thanks for your time in advance.
0
Rosi
Telerik team
answered on 02 Nov 2015, 08:20 AM
Hello,

Thank you for noticing this. This behavior is not implemented in our GitHub example but you can hook RadScheduleView events to check for overlapping appointments when creating/editing appointments.
A sample code can be found in the forum post below:
http://www.telerik.com/forums/how-to-avoid-overlap-appointment


Regards,
Rosi
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Sarif
Top achievements
Rank 1
answered on 02 Nov 2015, 01:38 PM
Thanks for this link, didn't see it. I'll try.
Tags
ScheduleView
Asked by
Sarif
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Sarif
Top achievements
Rank 1
Share this question
or