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

Selected date when clicking an appointment

3 Answers 138 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 12 Aug 2010, 09:43 AM
Hi there

We have appointments that span multiple days
Is there a way to determine the individual date that was clicked when I click on an appointment?

For example, if I have an appointment that runs from the 9th - 13th August, and I click on the appointment on the 12th, is there a way I can determine which day of the appointment I have selected?

Thanks

3 Answers, 1 is accepted

Sort by
0
Dobry Zranchev
Telerik team
answered on 17 Aug 2010, 07:18 AM
Hello Andy,

Thank you for writing.

You could use the following code snippet to get the selected appointment and take the start date from it.
SchedulerUIHelper.GetSelectedAppointment(this.radScheduler1)
You can access the clicked cell through the GetCellAtPoint method of the SchedulerUIHelper. Once you have this cell, you can easily get the date you are looking for.

Feel free to write us for additional questions.

All the best,
Dobry Zranchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Andy
Top achievements
Rank 1
answered on 17 Aug 2010, 09:50 AM
Thanks Dobry

Our appointments span multiple days, so the first method would not work
However, the second method worked, using the following code:

 

Dim ClickedPoint As New Point(e.X, e.Y)

 

 

Dim ViewElement As SchedulerTimelineViewElement = RadScheduler1.SchedulerElement.ViewElement

 

 

Dim ClickedCell As SchedulerCellElement

 

ClickedCell = SchedulerUIHelper.GetCellAtPoint(ClickedPoint, ViewElement.Children(1).Children)

 

Dim ClickedDate As Date = ClickedCell.Date

Is this the best method?

Andy

 

0
Dobry Zranchev
Telerik team
answered on 20 Aug 2010, 07:39 AM
Hi Andy,

Thank you very much for the provided snippet.

Would you please try replacing the following piece of code:
ClickedCell = SchedulerUIHelper.GetCellAtPoint(ClickedPoint, ViewElement.Children(1).Children)
with this line:
ClickedCell = SchedulerUIHelper.GetCellAtPoint(ClickedPoint, ViewElement.Presenter.Children)

I hope you find this helpful. Feel free to contact me if you need further assistance. 

Best wishes,
Dobry Zranchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Scheduler and Reminder
Asked by
Andy
Top achievements
Rank 1
Answers by
Dobry Zranchev
Telerik team
Andy
Top achievements
Rank 1
Share this question
or