Draw a tree or organization chart from parent data

I have parent-child information in a table with GroupID (TreeID.)

Enter image description here

From this table I want to get something like this:

Enter image description here

The purpose of drawing a tree is for viewing purposes only. The table shows thousands of groupID / tree structures.

I am using the .NET platform.

How should I proceed?

create table parent_child (GroupID varchar(100) null, Level varchar(100) null, Name varchar(100) null, ID varchar(100) null, ParentID varchar(100) null, Top_Parent varchar(100) null) insert into parent_child (GroupID,Level, Name,ID,ParentID,Top_Parent) values ('1234', '4', 'James', '6712', '921', '1005'), ('1234', '3', 'Peter', '11', '206', '1005'), ('1234', '3', 'Royden', '14', '206', '1005'), ('1234', '3', 'Lila', '237', '589', '1005'), ('1234', '3', 'Julie', '921', '589', '1005'), ('1234', '2', 'Sandy', '206', '1005', '1005'), ('1234', '2', 'Tom', '589', '1005', '1005'), ('1234', '1', 'Sam', '1005', 'NA', '1005') 
+4
source share
1 answer

The graphical tree control for WPF article (at Code Draft ) explains how to achieve what you mean in both WPF and Silverlight . Kudo guy who made the code available - it is well written and very easy to configure.

Screenshot from the Code project site:

Enter image description here

You will need to write logic to convert the table data into a compatible data structure.

I hope this article helps!

0
source

Source: https://habr.com/ru/post/1348142/


All Articles