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

ConnectionType="Polyline" but still Straight

1 Answer 100 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
YB
Top achievements
Rank 1
YB asked on 10 Mar 2014, 03:35 AM
Here is my code :
<Grid>
        <telerik:RadDiagram>
            <telerik:RadDiagramShape Position="100,50" Width="100" Height="80" Name="one"/>
            <telerik:RadDiagramShape Position="250,100" Width="100" Height="80" Name="two"/>
            <telerik:RadDiagramShape Position="350,200" Width="100" Height="80" Name="three"/>
            <telerik:RadDiagramConnection Source="{Binding ElementName=one}" Target="{Binding ElementName=three}" ConnectionType="Polyline"/>
        </telerik:RadDiagram>
    </Grid>

The RadDiagramConnection is still Straight,why ?

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 12 Mar 2014, 04:07 PM
Hi,

A polyline (or polygonal chain) is a continuous line composed of one or more line segments. You can create such a line by specifying the end points of each segment. In your case you have a connection between two shapes which means that you have a one start point and one end point and it is expected for the connection to be straight (you have a single line segment). If you want your line not to be straight you can define more end points in your Connection's ConnectionPoints collection. Here is an example in code:
xConnection.ConnectionPoints.Add(new Point(220, 90));
xConnection.ConnectionPoints.Add(new Point(220, 240));

However, you can automatically route (without using the ConnectionPoints collection) the connections so that they won't cross each other. You can do this when you set the ConnectionType of the connection to Polyline and set the Diagram RouteConnections property to True.

Also you can take a look at the Types section in the Connections help article where you can find more information about the connection types and how they are used.

Regards,
Martin
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
Diagram
Asked by
YB
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or