Navigating to next week programmatically

5 posts, 0 answers
  1. Oneview Corp
    Oneview Corp avatar
    18 posts
    Member since:
    Sep 2009

    Posted 09 Oct 2015 Link to this post

    Hi,

    We allow users to see availability and book appointments online. However, there are some weeks (and towards the end of the week like Friday/Sat) where there is no availability left. Users see all grayed out timeslots and get confused.

    So in these cases, we would like to take the users to the next week or better, the first week that has an available appointment. How can we do that?

    - one implementation that comes to mind is to check for empty time slots in the date range and programmatically take the user to the week that has at least one empty time slot (timeslot that does not have an appointment). Can we do this? How?

    The second question I have is around error messages. Right now, if the users cannot book an appointment due to some business reason, we handle it on the server side events. But there all we can do is e.cancel. How do we bubble up these error messages to the client side to show them to the user in their browser?

  2. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 14 Oct 2015 Link to this post

    Hi,

    You can get a reference to all of the currently visible appointments for the selected view with the following code:
    RadScheduler1.DataBind();
    var aptsInRange = RadScheduler1.Appointments.GetAppointmentsInRange(RadScheduler1.VisibleRangeStart, RadScheduler1.VisibleRangeEnd);

    If you want to advance the selected view, you can use the following code, which will show the next week:
    RadScheduler1.SelectedDate = RadScheduler1.SelectedDate.AddDays(7);

    As for propagating error messages to the client, you can use the aproach from the following demo page:
    http://demos.telerik.com/aspnet-ajax/scheduler/examples/limitconcurrentappointments/defaultcs.aspx

    Regards,
    Bozhidar
    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 ASP.NET Ajax is Ready for VS 2017
  4. Oneview Corp
    Oneview Corp avatar
    18 posts
    Member since:
    Sep 2009

    Posted 23 Oct 2015 in reply to Bozhidar Link to this post

    Hi,

    Which event would I ideally this code from? Page_Load() ? Form_Created()? Databound?

    I want to avoid refresh issues where the page refreshes visibly a couple of times before ending up on a week that has appointments.

     

    thanks

  5. Oneview Corp
    Oneview Corp avatar
    18 posts
    Member since:
    Sep 2009

    Posted 23 Oct 2015 in reply to Bozhidar Link to this post

    Actually what we need is the inverse. We do not need to get the current list of appointments but the current list of open timeslots.

    If there is no timeslot that is open (all are filled with an appointment or non-business  hours/days), then go to the next week.

  6. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 28 Oct 2015 Link to this post

    Hello,

    You can check the TimeSlots of the week in the RadScheduler's TimeSlotCreated event handler. In it you can get information about each TimeSlot through the event's arguments (e.Timeslot), for example you can check whether there is an appointment in the TimeSlot using the following properties: e.TimeSlot.Appointments.Count (Count will return 0 if there are none).
    e.TimeSlot.Start.DayOfWeek will help you check whether the TimeSlot spans a non-business day (Saturday, Sunday).

    Regards,
    Ivan Danchev
    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017