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

Jump to Slot and highlight in code behind

5 Answers 8 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
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

5 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 24 Mar 2014, 12:49 PM
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:

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
0
Kalin
Telerik team
answered on 25 Mar 2014, 09:54 AM
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
 

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
0
Kalin
Telerik team
answered on 27 Mar 2014, 11:31 AM
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:

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.

 
Tags
ScheduleView
Asked by
Pim Kerkhof
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Pim Kerkhof
Top achievements
Rank 1
Share this question
or