mnuContext Opening event

Posted by: craigguthrie72 on 15 July 2019, 3:24 am EST

    • Post Options:
    • Link

    Posted 15 July 2019, 3:24 am EST

    I have a VB app using TrueDBGrid which I am moving to C#.

    When I right click on the grid at run-time I get the context menu popup up. I then add code to alter some text on the fly in ‘opening’ handler:

            private void MnuContext_Opening(object sender, System.ComponentModel.CancelEventArgs e)
            {
                MenuOpeningHandler(sender, e);
            }
    
    

    This is called ok but the menu no longer pops up. I assume the handler must pass event to propagate on to the ContextMenuStrip - can anyone point me to how to do that?

  • Posted 15 July 2019, 3:36 am EST

    Same happens if I set e.Cancel = false;

  • Posted 15 July 2019, 10:03 pm EST

    Hello Craig,

    Sorry but I could not replicate the issue at my end while altering the values in the Opening handler of ContextMenuStrip or setting e.Cancel = false in the opening handler.

    At my end I am altering in both contextmenustrip items and TrueDbGrid’s cell but I can see the context menu.

    Note : To set the contextmenustrip to the TrueDbGrid assingn the contextmenustrip object to the ContextMenuStrip property of TrueDbGrid.

    Please go through the attached sample for better understanding and make respective changes in the sample to replicate the issue or provide your stripped down sample so that we can narrow down the issue.

    Thanks and Regards,

    Prabhat Sharma.

    TDBContextMenuDemo.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels