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

Navigating to next week programmatically

4 Answers 73 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Oneview Corp
Top achievements
Rank 1
Oneview Corp asked on 09 Oct 2015, 05:51 PM

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?

4 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 14 Oct 2015, 07:55 AM
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
0
Oneview Corp
Top achievements
Rank 1
answered on 24 Oct 2015, 12:58 AM

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

0
Oneview Corp
Top achievements
Rank 1
answered on 24 Oct 2015, 01:27 AM

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.

0
Ivan Danchev
Telerik team
answered on 28 Oct 2015, 06:46 PM
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
Tags
Scheduler
Asked by
Oneview Corp
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Oneview Corp
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or