AutoLayout issue in SfDiagram

Hi there!

Currently i am working on a WPF project and using SfDiagram control. I need to show a workflow on diagram, but i got one issue.
My question is : Why layout goes wrong if i set a parentId for root node?
For example:
it is okay:
node1:{Id: "1", ParentId:"", Content: "Node1"}
node2:{Id: "2", ParentId:"1", Content: "Node1"}
node3:{Id: "3", ParentId:"2", Content: "Node1"}

layout go wrong:
node1:{Id: "1", ParentId:"2", Content: "Node1"}
node2:{Id: "2", ParentId:"1", Content: "Node1"}
node3:{Id: "3", ParentId:"2", Content: "Node1"}

please see the attached pics, thanks.


Attachment: folder_24149cb6.7z

1 Reply 1 reply marked as answer

KR Keerthivasan Ramamoorthy Syncfusion Team September 21, 2020 10:30 AM UTC

Hi Zhenyugu, 
 
Requirement: “Need to set a parentId for root node”. 
 
We don’t have a support to achieve your requirement by using layout. By default, the node without parent is treated as root of the layout. However, we able to achieve your requirement by creating the nodes and connectors programmatically. Please refer the sample and screenshot as below. 
 
 
Screenshot: 
 
If you need this behavior in layout, you need to inherit the layout and do the position in the UpdateLayout method. 
 
Regards, 
Keerthivasan R. 


Marked as answer
Loader.
Up arrow icon