change a line connector length

Hi 
I'm Using vs 2022 , .NET 6 , syncfusion ver: 20.4.0.44
I want to know How Can I change the length of a line connector that already exists on the diagram 

Untitled.png

for example :
I want if a button is clicked, Change the length of  this selected Orthogonal Connector  And 

Subsequently, the Right Node must go further and this length change must not break the connection between 2 shapes!!


how can I Achieve this??

thanks, A lot



2 Replies

KR Karkuvel Rajan Shanmugavel Syncfusion Team April 18, 2023 01:35 PM UTC

Hi Mohammad,


Currently, we are validating your requirement with the provided details. We will update you with more details on April 20, 2023.


Regards,

Karkuvel Rajan S



KR Karkuvel Rajan Shanmugavel Syncfusion Team April 20, 2023 10:07 AM UTC

Hi Mohammad,


We have validated your requirement and it can be achieved by changing the position of the Connected nodes only. We have to adjust the position of the Connected Nodes by changing their PinPoint. Please find the below code example to achieve your requirement.


 

            NodeCollection selectionList = this.diagram1.View.SelectionList;

            OrgLineConnector connector = selectionList[0] as OrgLineConnector;

            if(connector.FromNode != null)

            {

                Node node = connector.FromNode as Node;

                PointF pt = node.PinPoint;

                // Modify the X and Y position based on your requirement.

                node.PinPoint = new PointF(pt.X, pt.Y + 50);

            }

            if(connector.ToNode != null)

            {

                Node node = connector.ToNode as Node;

                PointF pt = node.PinPoint;

                // Modify the X and Y position based on your requirement.

                node.PinPoint = new PointF(pt.X, pt.Y - 50);

            }

 


Regards,

Karkuvel Rajan S


Loader.
Up arrow icon