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

[Solved] Context Menu Per Appointment

1 Answer 147 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 19 Feb 2010, 02:49 PM
I have a role based scheduler. Each appointment can either be just viewed or edited and viewed. Is there a way to dynamically create the context menu per event based on a persons security role.

jason

1 Answer, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 19 Feb 2010, 04:12 PM
Hi Jason,

Yes, you need to create two appointment context menus:
<AppointmentContextMenus> 
           <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu" > 
               <Items> 
                   <telerik:RadMenuItem Text="Edit" Value="CommandEdit" /> 
                   <telerik:RadMenuItem Text="Delete" Value="CommandDelete" ImageUrl="../App_Themes/delete.gif" /> 
                   <telerik:RadMenuItem IsSeparator="true"> 
                   </telerik:RadMenuItem> 
                   <telerik:RadMenuItem Text="Workflow History" Value="Workflow History" /> 
                   <telerik:RadMenuItem IsSeparator="true"> 
                   </telerik:RadMenuItem> 
                   <telerik:RadMenuItem Text="Audit History" Value="Audit History" /> 
               </Items> 
           </telerik:RadSchedulerContextMenu> 
            <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu1" > 
               <Items> 
                    
                   <telerik:RadMenuItem Text="Delete" Value="CommandDelete" ImageUrl="../App_Themes/delete.gif" /> 
                   <telerik:RadMenuItem IsSeparator="true"> 
                   </telerik:RadMenuItem> 
                   <telerik:RadMenuItem Text="Workflow History" Value="Workflow History" /> 
                   <telerik:RadMenuItem IsSeparator="true"> 
                   </telerik:RadMenuItem> 
                   <telerik:RadMenuItem Text="Audit History" Value="Audit History" /> 
               </Items> 
           </telerik:RadSchedulerContextMenu> 
       </AppointmentContextMenus>

And then set the ContextMenuID property of the appointment conditionally:
protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e) 
    { 
          
            if (condition1) 
            { 
                e.Appointment.ContextMenuID = "SchedulerAppointmentContextMenu"; 
            } 
            else if(condition2
            { 
                e.Appointment.ContextMenuID = "SchedulerAppointmentContextMenu1"; 
            } 
    }

Here is the help topic for reference:
http://www.telerik.com/help/aspnet-ajax/scheduler-appointment-context-menu.html


All the best,
Peter
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.
Tags
Scheduler
Asked by
Jason
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or