ASPxDiagram.EdgeInserted Event
Occurs after an edge was inserted.
Namespace: DevExpress.Web.ASPxDiagram
Assembly: DevExpress.Web.ASPxDiagram.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
public event DiagramItemInsertedEventHandler EdgeInserted
#Event Data
The EdgeInserted event's data class is DiagramItemInsertedEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Affected |
Gets the number of records affected by the update operation.
Inherited from ASPx |
Exception |
Gets the exception (if any) that was raised during the update operation.
Inherited from ASPx |
Exception |
Gets or sets whether an exception raised during the update operation was handled in the event handler.
Inherited from ASPx |
Key |
Specifies the key value of the inserted item. |
New |
Gets a dictionary that contains the values of the non-key field name/value pairs in the row to be inserted.
Inherited from ASPx |
#Remarks
<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 ASPx
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;
}