Disable/hide context menu items for specific TimeSlots

4 posts, 0 answers
  1. Raghavendra
    Raghavendra avatar
    6 posts
    Member since:
    Dec 2011

    Posted 10 Jan 2012 Link to this post


    I want to disable/hide the New Appointment and New Recurring Appointment context menu items when the user right clicks on a TimeSlot which occurs in the past (i.e., date value is lesser than current system date time).

    At first, I thought the obvious place to put such functionality would be to handle OnClientTimeSlotContextMenu event of the scheduler. So, I added an event handler and it is firing properly. But now, I am clueless as to what method to call to achieve this functionality.

    Thanks in advance,
  2. Richard
    Richard avatar
    479 posts
    Member since:
    Nov 2011

    Posted 10 Jan 2012 Link to this post


    Have you reviewed the Appointment context menu documentation page for the RadScheduler? It provides insights on the setting that you need to manipulate, based on validity of the appointment's date.

    You could validate the date on the OnClientAppointmentContextMenuItemClicking event, which allows for the event to be canceled.

    Hope this helps.
  3. Ivana
    Ivana avatar
    657 posts

    Posted 12 Jan 2012 Link to this post


    You could subscribe to the OnClientTimeSlotContextMenu event and manipulate the context menu's items from within its handler, as shown in the following example:
    function OnClientTimeSlotContextMenu(sender, args) {
        var date = new Date();
        if (args.get_time() < date) {
        } else {
    <telerik:RadScheduler runat="server" ID="RadScheduler1" OnClientTimeSlotContextMenu="OnClientTimeSlotContextMenu"
            <telerik:RadSchedulerContextMenu ID="SchedulerAppointmentContextMenu" runat="server">
                    <telerik:RadMenuItem Text="Option 1" Value="1">
                            <telerik:RadMenuItem Text="Option 1.1 " Value="1.2" />
                    <telerik:RadMenuItem Text="Option 2" Value="2">
                    <telerik:RadMenuItem IsSeparator="True" />
                    <telerik:RadMenuItem Text="Option 3" Value="3" />

    I hope this would be helpful.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  4. Sac
    Sac avatar
    6 posts
    Member since:
    Jul 2012

    Posted 09 Jan 2013 Link to this post


    It really very helpful to me and save my time too.

    I just want to add that some time we need to use
    $find("<%=ContextMenu1.ClientID %>").get_items().getItem(0).set_enabled(false);

    instead of


Back to Top