I am using a RadContextMenu on a RadScheduler.
I have hooked to the Opened event in order to dynamically control the menu, but I need to do that based on the appointment that was the target of the right-click. For example, I want to disable the "Edit Appointment" option if the user doesn't have permission to edit the particular appointment.
I can use the GetClickedElement property in the ItemClick event, but it doesn't work in the Opened event.
The following code seems to work in the Opened event. From the AppointmentSlot I can of course get to my appointment. Is there any problem with this:
Border apptBorder = (sender as RadContextMenu).GetClickedElement<Border>();
AppointmentSlot apptSlot = apptBorder.DataContext as AppointmentSlot;