New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Events

You can subscribe to all Diagram events and then use them to further customize the behavior of the Diagram.

For a complete example on Diagram events, refer to the demo on using the events of the Diagram.

Handling by Handler Name

The following example demonstrates how to subscribe to events by a handler name.

    @(Html.Kendo().Diagram()
        .Name("diagram")
        .Events(e => e
            .Add("onAdd")
        )
    )
    <script>
        // The Diagram instance is available as an e.sender or this.
        function onAdd(e) {
            // Handle the add event.
        }
    </script>

Handling by Template Delegate

The following example demonstrates how to subscribe to events by a template delegate.

    @(Html.Kendo().Diagram()
        .Name("diagram")
        .Events(e => e
            .Add(@<text>
              function(e) {
                  //Handle the add event inline.
              }
            </text>)
        )
    )

Next Steps

See Also

In this article