Skip to main content
All docs

DiagramNode Class

A diagram node.

Namespace: DevExpress.Web.ASPxDiagram

Assembly: DevExpress.Web.ASPxDiagram.v23.1.dll

NuGet Package: DevExpress.Web


public class DiagramNode :

The following members return DiagramNode objects:


When the ASPxDiagram control is bound to a data source (NodeDataSource), the control creates a DiagramNode object and raises the NodeDataBound event for every data item in the source.

You can access the processed DiagramNode object via the event argument’s Node property. Use the object’s properties to customize the node before it is finally rendered.

<dx:ASPxDiagram ID="Diagram" runat="server" Width="100%" Height="600px"
    NodeDataSourceID="DepartmentDemoDataSource" OnNodeDataBound="Diagram_NodeDataBound" >
        <Node Key="ID" ParentKey="ParentID" Text="DepartmentName" />
            <dx:DiagramToolboxGroup CustomCategoryName="Departments" DisplayMode="Texts" />
protected void Page_Load(object sender, EventArgs e) {
    if(!IsPostBack) {
static IEnumerable<DiagramCustomShape> GetDepartmentShapes() {
    return DepartmentDataProvider.GetDepartments().Select(d =>
        new DiagramCustomShape {
            Category = "Departments",
            DefaultText = d.DepartmentName,
            Type = "dep" + d.ID,
            BaseType = DiagramShapeType.Rectangle,
protected void Diagram_NodeDataBound(object sender, DiagramNodeEventArgs e) {
    e.Node.Type = "dep" + e.Node.Key;


See Also