ContextMenuID -- Does not work

4 posts, 0 answers
  1. Sean Overman
    Sean Overman avatar
    31 posts
    Member since:
    Sep 2012

    Posted 09 Nov 2009 Link to this post

    I am attempting to use the new ContextMenuID feature with no success.  Here is a simplified version of what I'm doing.

    <tel:RadScheduler ID="RadScheduler1" runat="server"
        <TimeSlotContextMenus> 
            <tel:RadSchedulerContextMenu ID="TimeSlotMenu" runat="server" > 
                <Items> 
                    <tel:RadMenuItem Text="Menu Item 1" Value="1" /> 
                </Items> 
            </tel:RadSchedulerContextMenu> 
        </TimeSlotContextMenus> 
        <AppointmentContextMenus> 
            <tel:RadSchedulerContextMenu ID="AppointmentMenu1" runat="server" > 
                <Items> 
                    <tel:RadMenuItem Text="Menu Item 2" Value="2" /> 
                </Items> 
            </tel:RadSchedulerContextMenu>    
            <tel:RadSchedulerContextMenu ID="AppointmentMenu2" runat="server" > 
                <Items> 
                    <tel:RadMenuItem Text="Menu Item 3" Value="3" /> 
                </Items> 
            </tel:RadSchedulerContextMenu>    
        </AppointmentContextMenus> 
    </tel:RadScheduler> 
     
    public class TestApt { 
        public int ID { getset; } 
        public string Description { getset; } 
        public DateTime StartTime { getset; } 
        public DateTime EndTime { getset; } 
     
    protected void Page_Init(object sender, EventArgs e) { 
        RadScheduler1.DataKeyField = "ID"
        RadScheduler1.DataSubjectField = "Description"
        RadScheduler1.DataStartField = "StartTime"
        RadScheduler1.DataEndField = "EndTime"
        RadScheduler1.AppointmentDataBound += new AppointmentDataBoundEventHandler(RadScheduler1_AppointmentDataBound); 
     
    void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e) { 
        if ((int)e.Appointment.ID == 1) { 
            e.Appointment.ContextMenuID = "AppointmentMenu1"
        } else if ((int)e.Appointment.ID == 2) { 
            e.Appointment.ContextMenuID = "AppointmentMenu2"
        } else { 
            e.Appointment.ContextMenuID = ""
        } 
     
    protected void Page_Load(object sender, EventArgs e) { 
        if (!Page.IsPostBack) { 
            List<TestApt> apts = new List<TestApt>(); 
            apts.Add(new TestApt { ID = 1, Description = "Test1", StartTime = new DateTime(2009, 11, 9, 10, 0, 0), EndTime = new DateTime(2009, 11, 9, 11, 0, 0) }); 
            apts.Add(new TestApt { ID = 2, Description = "Test2", StartTime = new DateTime(2009, 11, 9, 11, 0, 0), EndTime = new DateTime(2009, 11, 9, 12, 0, 0) }); 
            apts.Add(new TestApt { ID = 3, Description = "Test3", StartTime = new DateTime(2009, 11, 9, 12, 0, 0), EndTime = new DateTime(2009, 11, 9, 13, 0, 0) }); 
     
            RadScheduler1.DataSource = apts; 
            RadScheduler1.DataBind(); 
        } 

    There are a couple of things that don't work here.
    #1 All appointments are using "AppointmentMenu1" as their context menu.
    #2 By setting the ContextMenuID equal to empty string, I am still getting a context menu on appointment 3.  (if this is by design, how can I accomplish this?)

    Thanks,

    Sean
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 12 Nov 2009 Link to this post

    Hello Sean,

    We have just recently discovered that this is a bug with RadScheduler. We will fix it for the upcoming service pack at the latest. Please, excuse us for any inconvenience caused by this bug.

    Regards,
    Peter
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Olivier
    Olivier avatar
    146 posts
    Member since:
    Nov 2010

    Posted 21 Oct 2015 Link to this post

    Hello

     

    Have you correct the bug, for the ContextMenu Custom add like this ?

    it's doesn't work for me and i haven't the custom menu.

    version : v2015.2.826.45

    thanks

     


     

    protected void RadScheduler1_AppointmentDataBound(object sender,SchedulerEventArgs e) {
               e.Appointment.ContextMenuID = "SchedulerAppointmentContextMenu2";
     
                
           }

  5. Olivier
    Olivier avatar
    146 posts
    Member since:
    Nov 2010

    Posted 21 Oct 2015 Link to this post

    Hello,

     I found my error, i wait on timeslot contextmenu and i use in appointment.

     

    sorry , it's works 

    thanks

Back to Top