Selected date when clicking an appointment

4 posts, 0 answers
  1. Andy
    Andy avatar
    9 posts
    Member since:
    Aug 2010

    Posted 12 Aug 2010 Link to this post

    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
  2. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 17 Aug 2010 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Andy
    Andy avatar
    9 posts
    Member since:
    Aug 2010

    Posted 17 Aug 2010 Link to this post

    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

     

  5. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 20 Aug 2010 Link to this post

    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
Back to Top