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

ContainerShape that "fills" the diagram area and with fixed shapes

4 Answers 87 Views
Diagram, DiagramRibbonBar, DiagramToolBox
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Veteran
Tom asked on 30 Sep 2020, 12:48 AM

I am planning to include two types of radDiagramContainerShape in my project:

1) The first one holds all the shapes that will be created and inserted into the Diagram; hence, it must fill the whole area of the diagram. In other words, it should behave as if it were docked to its parent (radDiagram) in dock.fill mode.
2) The second one will be created each time a "special" shape is instantiated. Then, that shape will be added and locked to it. This container should behave normally with any other shape, but the special one. The special shape must remain fixed to the container.

I have been reviewing the accessible properties and events, but I have not found a way of achieving it yet.

Thank you for your help!

 

4 Answers, 1 is accepted

Sort by
0
Tom
Top achievements
Rank 1
Veteran
answered on 01 Oct 2020, 03:11 PM

Hi,

Please allow me to explain a bit more my motivations:

The first container will contain all shapes; thereby, I can move them together by clicking on an "empty spot" of the Diagram and dragging it. Nevertheless, I saw the behavior I want to replicate here:  https://www.telerik.com/forums/export-diagram-image#C6uqgDAxH0ql53L9QJfmhw. Regrettably, Dess did not include an example of the code that allows me to see how it is done.

The idea behind the second container is to group elements and then move them together by clicking and dragging the locked shape. Additionally, by assigning them to the same group I could fill a property of the custom shape when it is assigned or moved to or from a container.

Thank you.

0
Tom
Top achievements
Rank 1
Veteran
answered on 01 Oct 2020, 04:19 PM

I am sorry for this third post in a row, but I cannot edit the previous one.

I found that we can pan through the diagram by activating the pan Tool. However, I need to discover how to activate it without ctr key; just by clicking on a empty region of the diagram.

Thank you.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Oct 2020, 02:08 PM

Hello, Tom,

I have attached the sample project that you were referring to from the forum post: https://www.telerik.com/forums/export-diagram-image#C6uqgDAxH0ql53L9QJfmhw

As to the RadDiagramContainerShape, you can simulate docking to fill the entire space by setting its Size to RadDiagram.Size. Thus the container will occupy the whole diagram. If you resize the diagram, it is necessary to resize the RadDiagramContainerShape as well. Then, populate the ocntainer with the desired shapes. I would recommend you to have a look at our Demo application >> Diagram examples for getting started experience with the diagram.

RadDiagram uses a PanningTool. In the internal implementation of handling the mouse moving, the Ctrl key is checked in order to execute the respective logic and activate the PanningTool. However, you can directly activate it without the necessity of pressing Ctrl: 

radDiagram1.ActiveTool = Telerik.Windows.Diagrams.Core.MouseTool.PanTool;
 I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Tom
Top achievements
Rank 1
Veteran
answered on 11 Nov 2020, 06:21 PM
Thank you Dess. It worked perfectly.
Tags
Diagram, DiagramRibbonBar, DiagramToolBox
Asked by
Tom
Top achievements
Rank 1
Veteran
Answers by
Tom
Top achievements
Rank 1
Veteran
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or