Producing diagrams from Data Binding

Hello,

Is there sample code and table data for the SQL DB-derived Org Chart shown here? https://help.syncfusion.com/windowsforms/diagram/data-binding

I am able to take parent/child data from my database (via a DataTable) and produce Nodes on a Diagram with correct labeling. However, these appear in the exact same position and are not connected by a line. I also want to change the appearance of the 'top' node in the chart to something different from the rest.

I understand how I would achieve this by programmatically adding nodes and connectors, but it is much less clear how this works with Data Binding.

Thank you,
Manny

3 Replies

AR Aravind Ravi Syncfusion Team May 20, 2020 12:05 PM UTC

Hi Emmanuel, 

We have created a sample to delete/remove and add/remove data in database using data bind. We have attached a sample for your reference. So please check the sample in below link 


Regards 
Aravind Ravi 



EM Emmanuel May 20, 2020 11:03 PM UTC

Thank you, Aravind. This helped my troubleshooting significantly.

For anyone reading - you must have an ID for every node in an OrgChart/Hierarchy - a Parent_ID alone is not enough. This may seem obvious, but the nature of my data meant that many nodes only had Parent_IDs.


AR Aravind Ravi Syncfusion Team May 21, 2020 07:52 AM UTC

Hi Emmanuel, 

By default if we want to arrange any layout in the diagram means we want to set both parent ID and Id for the node. So that layout gets arranged in the diagram. In the provided sample we have set Id and parent Id in the sample. Please find the below code snippet  

changeSetDiagram.Binding.ParentId = "ParentStep"; 
changeSetDiagram.Binding.Id = "StepId"; 

If we misunderstood your requirements, please share us your requirement in detail or any image representation of your requirement which would help us to proceed further. 

Regards 
Aravind Ravi 


Loader.
Up arrow icon