Skip to main content

ASPxDiagram.NodeDataBound Event

Occurs after a node has been bound to a data source.

Namespace: DevExpress.Web.ASPxDiagram

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

NuGet Package: DevExpress.Web


public event DiagramNodeEventHandler NodeDataBound

Event Data

The NodeDataBound event's data class is DiagramNodeEventArgs. The following properties provide information specific to this event:

Property Description
Node Gets a node object related to the event.


The NodeDataBound event is raised for each diagram node after it has been bound to the data source. This event enables you to customize settings of the node before it is finally rendered. You can access the processed node via the Node property of the event’s argument.

<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