Setting up the RadDiagram control on the server-side through the code-behind is as straight-forward as can be expected. This approach is more dynamic than the descriptive declaration of the control and should be preferred when shapes and connections will be changed frequently.
In the provided demo the whole ASP.NET AJAX diagram is created in the code-behind. First some basic properties of the diagram are set, i.e. Width and Height. Then the common settings for the diagram shapes are specified in the ShapeDefaultsSettings composite property.
Shapes are created and added to the ShapesCollection. Finally connections are defined and again added to the ConnectionsCollection.