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

Binding Connector Position with RouteConnections-Property

7 Answers 36 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Veteran
Iron
Peter asked on 16 Apr 2021, 11:28 AM

Hello,

I'm using your provided method to manipulate the connector positions in MVVM:

https://docs.telerik.com/devtools/wpf/controls/raddiagram/howto/raddiagrams-mvvm#bind-the-source-and-target-connector-positions-of-the-connection

In my RadDiagram, I am using the RoutedConnections-Property for the auto routing mechanism as described here:

https://docs.telerik.com/devtools/wpf/controls/raddiagram/features/routing

With the OrgTreeRouter:

var router = new OrgTreeRouter()
{
     TreeLayoutType = TreeLayoutType.TreeRight,
     ConnectionOuterSpacing = 20,
};
_ctlDiagram.RoutingService.Router = router;

 

I am setting the Route-Property for the specific RadDiagramConnection to False, but nothing happens...

Only if I disable the RoutedConnections-Property, I can achieve the behaviour I want, but then the connections are no longer routed at all.

I attach two screenshots to help you to understand my issue.

Can you help me with that?

regards,

Tobias

7 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
Veteran
Iron
answered on 19 Apr 2021, 12:23 PM

Hello,

I solved the issue by using the AStarRouter:

https://docs.telerik.com/devtools/wpf/controls/raddiagram/features/routing#astarrouter

regards,

Tobias

0
Peter
Top achievements
Rank 1
Veteran
Iron
answered on 20 Apr 2021, 07:03 AM

Hello again,

one question to this topic:

Is there a way to use different Routing-Properties for different parts of the diagram? E.g. I am using the AStarRouter and want to set the property AvoidConnectionOverlap just for some parts of the diagram.

regards,

Tobias

0
Petar Mladenov
Telerik team
answered on 22 Apr 2021, 08:35 AM

Hello Peter,

Each RadDiagramConnection has Route boolean property. You can iterate a group of connections and disable their Route property and they won't be updated by the diagram Router. Please give this approach a try and let s know how it goes.

Regards,
Petar Mladenov
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

0
Peter
Top achievements
Rank 1
Veteran
Iron
answered on 22 Apr 2021, 12:18 PM

Hello,

thanks for your reply. I already know the Route-Property, but if I disable it in my RadDiagramConnection-Style, nothing happens. Only if I disable the RouteConnections-Property or don't set the router at all, the routing goes away...

I am using a MVVM approach btw.

Is it mandatory to group the connections before disable the Route-Property? And how can I reach this in a MVVM approach?

regards,

Tobias

0
Petar Mladenov
Telerik team
answered on 23 Apr 2021, 03:26 PM

Hi Peter,

I am sending you a modified version of our PascalTriangle SDK demo. I added Rote property in the PascalEdge model and bound it  to the Route property of the RadDiagramConnection via Style setter. Some of the models have their Route property set to True, rest are false. You can see the result in the attached picture. No need to group visually the connections that won't be routed, however, I am not sure if this answers your question. I hope since the project is MVMM based, it will help you move forward. 

Regards,
Petar Mladenov
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
Peter
Top achievements
Rank 1
Veteran
Iron
answered on 26 Apr 2021, 07:16 AM

Hi Petar,

thanks for your reply and the provided code sample. I was able to clarify the problem by setting the ConnectionStyle-Property of the RadDiagram explicitly. Now I can control the Route-Property in my ViewModel. Nice!

In my Diagram I want the routing but with different properties for some connections. Is there a similiar approach to control the AvoidConnectionOverlap-Property of the AStarRouter?

regards,

Tobias

0
Petar Mladenov
Telerik team
answered on 28 Apr 2021, 04:02 PM

Hello Peter,

Properties of Router will have affect on all routed connections. So there is way to specify router properties on a connection level. The closest approach to this is to temporary set properties of the router, then route only connections you need to update with this settings.

To route a single connection (manually) you can also cast it to IConnection and call the Update method.

 

Regards,
Petar Mladenov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Diagram
Asked by
Peter
Top achievements
Rank 1
Veteran
Iron
Answers by
Peter
Top achievements
Rank 1
Veteran
Iron
Petar Mladenov
Telerik team
Share this question
or