Finding out which Appointment was double-clicked.

2 posts, 0 answers
  1. Oliver
    Oliver avatar
    17 posts
    Member since:
    Aug 2008

    Posted 19 Oct 2012 Link to this post

    Hello!

    I have my RadScheduler's DoubleClick event written to display a custom form from a program that Telerik controls are embedded in.  The problem is, I can't figure out how to find out which Appointment was selected when the user double-clicks one to edit in the RadScheduler.  I've tried adding an AppointmentSelecting event handler, but then I can't drag and drop.  Using a custom edit appointment form is not an option.  What should I do?

    Thanks.
  2. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 22 Oct 2012 Link to this post

    Hello Julia,

    Thank you for your question.

    You can use the MouseDoubleClick event of RadScheduler and the mouse location in its arguments to detect the if the element under the mouse is an AppointmentElement:
    private void radScheduler1_MouseDoubleClick(object sender, MouseEventArgs e)
    {
        AppointmentElement appointmentElement = this.radScheduler1.ElementTree.GetElementAtPoint(e.Location) as AppointmentElement;
        if (appointmentElement != null)
        {
            RadMessageBox.Show(appointmentElement.Appointment.Summary);
        }
    }

    Additionally, if you need to get the currently selected appointment, you can use the following method:
    SchedulerUIHelper.GetSelectedAppointment(this.radScheduler1);

    I hope this will help you. Should you have any additional questions, do not hesitate to write back.

    Kind regards,
    Ivan Todorov
    the Telerik team
    You’ve been asking for it and now it’s time for us to deliver. RadControls for WinForms Q3 2012 release is just around the corner. Sign up for a free webinar to see first all the latest enhancements.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top