The DevExpress ASP.NET Diagram (ASPxDiagram) control can load a tree or a graph structure from two data sources: one for shapes (NodeDataSourceID) and another for shape connectors (EdgeDataSourceID). You should add mapping information for a shape's Key and a connector's Key, FromKey and ToKey properties. Optionally, you can specify other mapping properties for shapes and mapping properties for connectors.
The SettingsAutoLayout property allows you to specify an auto-layout algorithm and orientation that the control uses to build a diagram.
In this demo, the NodeInserted and EdgeInserted events are handled to provide items with key values (KeyValue).