The DevExpress ASP.NET Diagram (ASPxDiagram) control can transform a linear data structure to a tree-like diagram.
The NodeDataSourceID property specifies which data source the control is bound to. To transform a linear data structure to hierarchical, the data source should contain two additional fields:
- The first field - assigned to the Key property and contains unique values.
- The second field - assigned to the ParentKey property and contains values that indicate the current node's parent nodes.
You can bind other node settings to the data source. Assign field values to the corresponding settings in the Mappings.Node property.
In this demo, the NodeInserted event is handled to provide nodes with key values (KeyValue).