All docs
V20.2
20.2
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

ASPxDiagram.NodeDataSourceID Property

Specifies the ID of the control from which the ASPxDiagram control retrieves information about nodes.

Namespace: DevExpress.Web.ASPxDiagram

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

Declaration

[DefaultValue("")]
public virtual string NodeDataSourceID { get; set; }
<DefaultValue("")>
Public Overridable Property NodeDataSourceID As String

Property Value

Type Default Description
String

String.Empty

The control ID.

Remarks

Use the Mappings.Node property to specify node mapping properties.

<dx:ASPxDiagram ID="Diagram" runat="server" Width="100%" Height="600px" Units="In"
    NodeDataSourceID="FlowNodeDataSource" EdgeDataSourceID="FlowEdgeDataSource" 
    OnNodeInserted="Diagram_ItemInserted" OnEdgeInserted="Diagram_ItemInserted" >
    <SettingsAutoLayout Type="Layered" Orientation="Vertical" />
    <Mappings>
        <Node Key="ID" Type="Type" Width="Width" Height="Height" />
        <Edge Key="ID" FromKey="FromID" ToKey="ToID" Text="Text" />
    </Mappings>
</dx:ASPxDiagram>
<ef:EntityDataSource runat="server" ID="FlowNodeDataSource" ContextTypeName="DevExpress.Web.Demos.FlowContextSL" 
  EntitySetName="Nodes" EnableDelete="True" EnableInsert="True" EnableUpdate="True" OnInserted="FlowItemDataSource_Inserted">
</ef:EntityDataSource>
<ef:EntityDataSource runat="server" ID="FlowEdgeDataSource" ContextTypeName="DevExpress.Web.Demos.FlowContextSL" 
  EntitySetName="Edges" EnableDelete="True" EnableInsert="True" EnableUpdate="True" OnInserted="FlowItemDataSource_Inserted">
</ef:EntityDataSource>
IMPORTANT

When you bind the ASPxDiagram control to a data source, ensure that the KeyValue property is specified.

protected void FlowItemDataSource_Inserted(object sender, Microsoft.AspNet.EntityDataSource.EntityDataSourceChangedEventArgs e) {
    if (e.Entity is FlowEntity)
        lastInsertedId = ((FlowEntity)e.Entity).ID;
}

protected void Diagram_ItemInserted(object sender, DevExpress.Web.ASPxDiagram.DiagramItemInsertedEventArgs e) {
    e.KeyValue = lastInsertedId;
}

Run Demo: Node and Edge Data Sources

See Also