This is a migrated thread and some comments may be shown as answers.

Context Menu with Diagram Shapes

2 Answers 102 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Sheldon
Top achievements
Rank 1
Sheldon asked on 26 Aug 2020, 05:00 AM

I need a Context Menu to pop up on right-clicking any Shape in RadDiagram, a different Context Menu upon right-clicking a Connection, and nothing at all on right-clicking white space.  I have experimented with setting "RadDiagram1" as a Target, but unlike the OnClick client-side event, which runs only if the user clicks on a shape or connection, setting the entire diagram as a Target does not differentiate between shape, connection and white space when right-clicked. So far, I have not found a way to specify a Shape or Connection as the Target.  Can somebody suggest a solution?  

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 28 Aug 2020, 02:10 PM

Hi Sheldon,

I am afraid that the desired functionality cannot be achieved with RadDiagram for the moment. You can easily integrate RadDiagram with RadContextmenu control, but the OnClick event of RadDiagram is raised only on left click over a shape/connection and thus you cannot access the shape, over which the context menu is shown. I hope this information will spent you a little time in researching the case.

What you can try is to use Kendo Diagram and ContextMenu as shown in this article: https://docs.telerik.com/kendo-ui/controls/diagrams-and-maps/diagram/how-to/show-context-menu-over-shapes

Regards,
Rumen
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

0
Sheldon
Top achievements
Rank 1
answered on 30 Aug 2020, 02:40 AM
Thank you, Rumen.
Tags
Diagram
Asked by
Sheldon
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Sheldon
Top achievements
Rank 1
Share this question
or