1

Can anyone tell me if I can customise the Telerik Scheduler context menu on a per appointment basis?

For example, I have a scheduler control containing patients. When the patient arrives, the context menu is currently displayed and "Arrived" is displayed to start a timer.

If the current day view is NOT today's view then it obviously doesn't make sense to indicate that the patient has arrived.

I can't see anywhere of doing this. Has anyone got any experience with it?

Paul
  • 3,072
  • 6
  • 37
  • 58

1 Answers1

2

Bugger, I should really have looked a little further.

The answer is to create another context menu like this:

<telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu">
                            <Items>
                                <telerik:RadMenuItem Text="Arrived" Value="1" ImageUrl="~/Images/add.png" ></telerik:RadMenuItem>
                                <telerik:RadMenuItem Text="Cancelled" Value="2" ImageUrl="~/Images/cancel.png"></telerik:RadMenuItem>
                                <telerik:RadMenuItem Text="Details" Value="3" ImageUrl="~/Images/telephone.png"></telerik:RadMenuItem>
                            </Items>
                        </telerik:RadSchedulerContextMenu>
                        <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenuNotToday">
                            <Items>
                                <telerik:RadMenuItem Text="Cancelled" Value="2" ImageUrl="~/Images/cancel.png"></telerik:RadMenuItem>
                                <telerik:RadMenuItem Text="Details" Value="3" ImageUrl="~/Images/telephone.png"></telerik:RadMenuItem>
                            </Items>
                        </telerik:RadSchedulerContextMenu>

And then bind the appointment to whichever menu you need:

protected void scheduleDiary_AppointmentDataBound(object sender, SchedulerEventArgs e)
{
    if (e.Appointment.Start.Date != DateTime.Now.Date)
        e.Appointment.ContextMenuID = "SchedulerAppointmentContextMenuNotToday";

    e.Appointment.BackColor = System.Drawing.Color.Red;
}
Paul
  • 3,072
  • 6
  • 37
  • 58
  • Thanks for this! Most of the solutions given on the Telerik forums involve client-side scripting, but this is much better for my needs. – Robert Johnson Jan 23 '13 at 10:15