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

Finding out which Appointment was double-clicked.

1 Answer 167 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 19 Oct 2012, 07:32 PM
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.

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 22 Oct 2012, 03:07 PM
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.
Tags
Scheduler and Reminder
Asked by
Oliver
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or