Pim Kerkhof
Top achievements
Rank 1
Pim Kerkhof
asked on 24 Mar 2014, 07:39 AM
Hello,
I'im creating a search function and need a way to jump to a free timeslot and highlight it?
Can you provide a solution?
Regards,
Pim
I'im creating a search function and need a way to jump to a free timeslot and highlight it?
Can you provide a solution?
Regards,
Pim
5 Answers, 1 is accepted
0
Hello Pim,
There isn't a straight forward approach to achieve the desired scenario as the Slots don't contain any information whether they are empty or not. What you will need to do is to manually find the free space between the existing Appointments and then you will be easily able to highlight the desired slot using the SelectedSlot property of the ScheduleView. Once you have the Slot selected you can show it by using the ScrollIntoView method of the Schedule view:
Hope this helps.
Regards,
Kalin
Telerik
There isn't a straight forward approach to achieve the desired scenario as the Slots don't contain any information whether they are empty or not. What you will need to do is to manually find the free space between the existing Appointments and then you will be easily able to highlight the desired slot using the SelectedSlot property of the ScheduleView. Once you have the Slot selected you can show it by using the ScrollIntoView method of the Schedule view:
var slot =
new
Slot(DateTime.Today.AddHours(17), DateTime.Today.AddHours(18));
this
.scheduleView.SelectedSlot = slot;
this
.scheduleView.ScrollIntoView(slot);
Hope this helps.
Regards,
Kalin
Telerik
Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.
0
Pim Kerkhof
Top achievements
Rank 1
answered on 24 Mar 2014, 02:14 PM
Hello Kalin,
ScrollIntoView does work as expected.
SelectedSlot does not highlight the selectedslot however.
It did work in a earlier version however.
We currently use 2013.3.1204.
Regards,
Pim
ScrollIntoView does work as expected.
SelectedSlot does not highlight the selectedslot however.
It did work in a earlier version however.
We currently use 2013.3.1204.
Regards,
Pim
0
Hi Pim,
I tested the same code snippet with the mentioned version (2013.3.1204) and everything work as expected. I'm attaching the video of the test as well as the sample project I have used. Please test it and let me know if you still have issues (if so let me know what I have missed here).
I'm looking forward to hearing from you.
Regards,
Kalin
Telerik
I tested the same code snippet with the mentioned version (2013.3.1204) and everything work as expected. I'm attaching the video of the test as well as the sample project I have used. Please test it and let me know if you still have issues (if so let me know what I have missed here).
I'm looking forward to hearing from you.
Regards,
Kalin
Telerik
Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.
0
Pim Kerkhof
Top achievements
Rank 1
answered on 26 Mar 2014, 01:58 PM
Hi Kalin,
We are using Resources. Perhaps that's the reason wy highlighting isn't working?
Kind regards,
Pim
We are using Resources. Perhaps that's the reason wy highlighting isn't working?
Kind regards,
Pim
0
Hi Pim,
If you are using Resources you will need to add the Resources you need to select to the Resources collection of the Slot. For example the sample project can be modified the following way in order to have all the slots of all Resources selected:
Hope this helps.
Regards,
Kalin
Telerik
If you are using Resources you will need to add the Resources you need to select to the Resources collection of the Slot. For example the sample project can be modified the following way in order to have all the slots of all Resources selected:
private
void
RadButton_Click(
object
sender, RoutedEventArgs e)
{
var resources = ((
this
.scheduleView.ResourceTypesSource
as
ResourceTypeCollection).First()
as
ResourceType).Resources;
var slot =
new
Slot(DateTime.Today.AddHours(17), DateTime.Today.AddHours(18), resources);
this
.scheduleView.SelectedSlot = slot;
this
.scheduleView.ScrollIntoView(slot,
true
);
}
Hope this helps.
Regards,
Kalin
Telerik
Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.