Custom QAT Right Click Menu / Or Custom Event

Posted by: ivan.stanojkovski on 26 July 2021, 12:16 am EST

  • Posted 26 July 2021, 12:16 am EST

    Hello

    Can we somehow achieve to have our custom menu on right-click or somehow override the RibbonButton MouseDown event?

    We need this because we want to make our Custom function to add selected items to a new custom C1RibbonTab instead of QuickAccessToolbar or to have option to our custom MouseDown event on RibbonButton.

    Something like on this example:


    Best regards.
  • Marked as Answer

    Replied 26 July 2021, 4:04 pm EST

    Hi,

    You can achieve this using the MouseUp event and the ShowContextMenu method of Ribbon. First, you need to add items to the context menu using the ContextMenuItems property of the Ribbon. Then you can use the MouseUp event and then the GetItemAt method of the Ribbon to get the item at the mouse location. If a RibbonButton or any other desired RibbonItem was clicked, you can use the ShowContextMenu method to show your custom context menu.
    Please refer to the sample attached and modify it according to your requirements.

    Regards
    Avnish

    RibbonContext.zip
  • Replied 4 May 2022, 1:43 am EST

    Thank you, Avnish.Kumar, it's working for the first level
    BUT - Any RibbonItem below RibbonMenu does not recognize MouseUp event.

    In this structure (pic) the custom context menu is working fine until RibbonButton3 and RibbonButton4.

    I wonder if there is any solution available for this?


    my code:
    RibbonContext.zip
  • Replied 4 May 2022, 3:06 pm EST

    Hi,

    We have escalated the issue to the development team to get their insights on this. We will let you know as soon as we have an update.

    Regards
    Avnish

    [Internal ID : C1WIN-27319]
  • Replied 4 May 2022, 10:18 pm EST

    Hi,

    As per the development team, there is no workaround for this case currently since the menu dropdown is shown in a separate dropdown form.
    We have posted a feature request to the development team. We will let you know when we have an update.

    Regards
    Avnish

    [C1WIN-27319]
  • Replied 12 May 2022, 8:03 pm EST

    Thanks, Avnish, for the reply.

    Is there any other way to change / modify the existing context menu for RibbonItem-s?
  • Replied 12 May 2022, 10:17 pm EST

    Hi,

    Sorry for the inconvenience but there is no other way currently to customize the context menu of the RibbonItems. The case has been reported to the development team and they are working on introducing new behavior to customize the context menu for ribbon items. We will let you know as soon as we have an update.

    Regards
    Avnish
Need extra support?

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

Learn More

Forum Channels