We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Moving Links Programatically

Case:-1 ---------- I am a NodeCollection that contains 2 Custom Symbols and a Link that connects between these 2 Custom Symbols. When I move the nodes to a different position using the command "diagram.MoveNodes", the Custom Symbols move to the new location. The link stays connected to the Symbols, but it still moves thru the original position before the Symbols were moved. How can I programatically move the Nodes relatively? Case:-2 ------- I am having a point Collection of the link that is connected between 2 symbols. I have to move these selected Symbols Programatically. When the nodes move to a new position I do know the new position of the Symbols. How do I update the PointF[] so that I can redraw the link again? Which is better :- Moving a Link if possible or Updating the PointF[] programatically and redraw the link. Pls let me know. Regards, Vinod

1 Reply

AD Administrator Syncfusion Team December 8, 2005 09:57 PM UTC

Vinod, When a symbol is moved, the links that connect to that symbol will be redrawn at the symbol''s new location. Hence if you have two symbols that are connected by a link, moving the two symbols will result in the link being adjusted to the new position. You do not have to explicitly select the link and apply a move to it as this should happen automatically. The following code shows how to use the MoveCmd to displace two symbols that are connected by a link. Applying the move the link will automatically redraw the link at the new position between the symbols. // Move Symbols sym1 and sym2 connected by a link MoveCmd movcmd = new MoveCmd(50,50); movcmd.Nodes.Add(sym1); movcmd.Nodes.Add(sym2); this.diagramComponent.Controller.ExecuteCommand(movcmd); I tested this condition with the new v 4.1.0.0 beta and it appears to work perfectly. Thanks, Prakash Surendra Syncfusion Inc.,

Loader.
Live Chat Icon For mobile
Up arrow icon