All docs
V19.2
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.

MVCxDiagramNodeUpdateValues<TNode, TKey> Class

Contains information about updated diagram nodes.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v19.2.dll

Declaration

public class MVCxDiagramNodeUpdateValues<TNode, TKey> :
        MVCxDiagramItemUpdateValues<TNode, TKey>
    where TNode : new()
Public Class MVCxDiagramNodeUpdateValues(Of TNode As New, TKey)
    Inherits MVCxDiagramItemUpdateValues(Of TNode, TKey)

Type Parameters

Name Description
TNode

The type of node.

TKey

The type of node key.

Remarks

@Html.DevExpress().Diagram(settings => {
    settings.Name = "Diagram";

    settings.BatchUpdateRouteValues = new { Controller = "DataBinding", Action = "NodesAndEdgesUpdate" };

    settings.Mappings.Node.Key = "ID";

    settings.Mappings.Edge.Key = "ID";
    settings.Mappings.Edge.FromKey = "FromID";
    settings.Mappings.Edge.ToKey = "ToID";

}).Bind(Model.Objects, Model.Connections).GetHtml()
        public ActionResult NodesAndEdgesUpdate(MVCxDiagramNodeUpdateValues<EditableFlowObject, int> 
        nodeUpdateValues, MVCxDiagramEdgeUpdateValues<EditableFlowConnection, int> edgeUpdateValues) {
            foreach(var item in nodeUpdateValues.Update)
                WorkflowDataProvider.UpdateObject(item);
            foreach(var itemKey in nodeUpdateValues.DeleteKeys)
                WorkflowDataProvider.DeleteObject(itemKey);
            foreach(var item in nodeUpdateValues.Insert) {
                var insertedItem = WorkflowDataProvider.InsertObject(item);
                nodeUpdateValues.MapInsertedItemKey(item, insertedItem.ID);
            }

            foreach(var item in edgeUpdateValues.Update)
                WorkflowDataProvider.UpdateConnection(item);
            foreach(var itemKey in edgeUpdateValues.DeleteKeys)
                WorkflowDataProvider.DeleteConnection(itemKey);
            foreach(var item in edgeUpdateValues.Insert) {
                var insertedItem = WorkflowDataProvider.InsertConnection(item);
                edgeUpdateValues.MapInsertedItemKey(item, insertedItem.ID);
            }

            return DiagramExtension.GetBatchUpdateResult(nodeUpdateValues, edgeUpdateValues);
        }

Online Demo

Diagram - Node and Edge Data Sources

Inheritance

Object
MVCxBatchUpdateValues<TNode, TKey>
MVCxDiagramItemUpdateValues<TNode, TKey>
MVCxDiagramNodeUpdateValues<TNode, TKey>
See Also