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

Events

The OrgChart exposes a variety of events that you can handle and further customize the behavior of the UI component.

For a complete example on the OrgChart events, refer to the OrgChart Events Demo.

Handling by Handler Name

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

    @(Html.Kendo().OrgChart()
      .Name("orgchart")
      .Events(e => e
            .Select("onSelect")
            .Change("onChange")
      )
    )
    <kendo-orgchart name="orgchart"
                    on-select="onSelect"
                    on-change="onChange">
    </kendo-orgchart>


    <script>
        function onSelect(e) {
            // Handle the "select" event.
        }

        function onChange(e) {
            // Handle the "change" event.
        }
    </script>

Handling by Template Delegate

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

    @(Html.Kendo().OrgChart()
      .Name("orgchart")
      .Events(e => e
            .Select(@<text>
                function() {
                    // Handle the select event inline.
                }
            </text>)
            .Change(@<text>
                function() {
                    // Handle the change event inline.
                }
            </text>)
      )
    )
    <kendo-orgchart name="orgchart"
                    on-select="function() {
                        // Handle the select event inline.
                    }"
                    on-change="function() {
                        // Handle the change event inline.
                    }">
    </kendo-orgchart>


Next Steps

See Also

In this article