Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
context menu in a time slot editor
posted
how can i set the context menu editor, when editing inside a time slot line? is there a way i get mouse down event?
Thanks, Marcelo.
  • 69832
    Offline posted

    EditorWithText editor = new EditorWithText();
    this.dayView.AppointmentEditor = editor;
    editor.AfterEnterEditMode += new EventHandler(this.editor_AfterEnterEditMode);
    editor.BeforeExitEditMode += new BeforeExitEditModeEventHandler(editor_BeforeExitEditMode);

    private void editor_AfterEnterEditMode(object sender, EventArgs e)
    {
        ContextMenu contextMenu = new ContextMenu();
        contextMenu.MenuItems.Add( "One" );
        contextMenu.MenuItems.Add( "Two" );
        contextMenu.MenuItems.Add( "Three" );

        this.dayView.Controls[0].ContextMenu = contextMenu;
    }

    private void editor_BeforeExitEditMode(object sender, BeforeExitEditModeEventArgs e)
    {
        //  TODO: Clean up context menu
    }

  • 2094
    Offline posted

     do you mean change the color of the "CONTEXT Menu" ??? Similar to that when you right mouse click in Windows Explorer?

    Or do you mean use context sensitive Ribbon tabs?

    Gees! I don't know what I was looking at when I read your post... it must be late! (1am) on second reading and after seeing Brians solution below I will retract my previous questions :)