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

Events

The Telerik UI MultiSelect for ASP.NET Core exposes multiple events that allow you to control and customize the behavior of the UI component.

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

Handling by Handler Name

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

    @(Html.Kendo().MultiSelect()
        .Name("multiselect")
        .BindTo(new string[] { "Item1", "Item2", "Item3" })
        .Events(e => e
            .Select("multiselect_select")
            .Change("multiselect_change")
        )
    )
    <script>
        function multiselect_select() {
            // Handle the select event.
        }

        function multiselect_change() {
            // Handle the change event.
        }
    </script>
    @{
        var multiSelect_data = new string[] { "Item1", "Item2", "Item3" };
    }

    <kendo-multiselect name="multiselect"
                       on-select="multiselect_select"
                       on-change="multiselect_change"
                       bind-to="multiSelect_data">
    </kendo-multiselect>
    <script>
        function multiselect_select() {
            // Handle the select event.
        }

        function multiselect_change() {
            // Handle the change event.
        }
    </script>

Handling by Template Delegate

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

    @(Html.Kendo().MultiSelect()
        .Name("multiselect")
        .BindTo(new string[] { "Item1", "Item2", "Item3" })
        .Events(e => e
            .Select(@<text>
                function() {
                    // Handle the select event inline.
                }
            </text>)
            .Change(@<text>
                function() {
                    // Handle the change event inline.
                }
            </text>)
        )
    )
    @{
        var multiSelect_data = new string[] { "Item1", "Item2", "Item3" };
    }

    <kendo-multiselect name="multiselect"
                       on-select="function() {
                           // Handle the select event inline.
                       }"
                       on-change="function() {
                          // Handle the change event inline.
                       }"
                       bind-to="multiSelect_data">
    </kendo-multiselect>

Next Steps

See Also

In this article