Contextmenu mousedown event

Posted by: fsegui on 1 September 2020, 7:34 am EST

    • Post Options:
    • Link

    Posted 1 September 2020, 7:34 am EST

    Hello,

    I’ve implemented a C1ContextMenu on a form. I’ve got a report control on this form and there is a mousedown event on this report control.

    If the mousedown event is raised, I call the ShowContextMenu method to display it.

    If the Popup is still displayed, when there is another mousedown event on the report control, the C1ContextMenu is closed (I get the Closed event correctly) but it does not raise the mousedown event for the report control.

    Is there a way to do this?

    Thanks

  • Posted 2 September 2020, 6:31 am EST

    Hi Florent,

    You can use the MouseDown event of C1FlexViewerPane as given in the code snippet below to show the context menu:

    c1FlexViewer1.Pane.MouseDown += Pane_MouseDown;
    
    private void Pane_MouseDown(object sender, MouseEventArgs e)
     {
      if(e.Button == MouseButtons.Right)
      c1ContextMenu1.ShowContextMenu(c1FlexViewer1, e.Location);
     }
    
    

    I have attached a sample implementing the same, please have a look. If you are doing something else then please let us know and modify the attached sample accordingly.

    Regards,

    Prabhat Sharma.

    ContextMenuReportDemo.zip

  • Posted 3 September 2020, 7:39 am EST

    Hi Prabhat Sharma,

    I see what I was doing wrong. I was passing the form as argument in the ShowContextMenu and not the report control itself.

    Works well now.

    Thanks for your quick feedback.

Need extra support?

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

Learn More

Forum Channels