WPF RadScheduler GetAllAppointments from selected Slot

5 posts, 0 answers
  1. Sarif
    Sarif avatar
    1 posts
    Member since:
    Sep 2015

    Posted 17 Sep 2015 Link to this post

    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.

  2. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 18 Sep 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sarif
    Sarif avatar
    2 posts
    Member since:
    Oct 2015

    Posted 30 Oct 2015 in reply to Rosi Link to this post

    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.
  5. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 02 Nov 2015 Link to this post

    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
  6. Sarif
    Sarif avatar
    2 posts
    Member since:
    Oct 2015

    Posted 02 Nov 2015 in reply to Rosi Link to this post

    Thanks for this link, didn't see it. I'll try.
Back to Top
UI for WPF is Visual Studio 2017 Ready