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

Events

The Telerik UI ListBox for ASP.NET Core exposes a number of events that allow you to control the behavior of the UI component.

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

Handling by Handler Name

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

    @(Html.Kendo().ListBox()
        .Name("listbox")
        .Events(e => e.Change("onChange"))
        ... //Additional configuration
    )

    <script>
        function onChange(e){
            // Handle the ListBox Change event that triggers when a specified item has been selected.
        };
    </script>
    <kendo-listbox name="listbox" on-change="onChange">
      <!-- additional configuration -->
    </kendo-listbox>

    <script>
        function onChange(e){
            // Handle the ListBox Change event that triggers when a specified item has been selected.
        };
    </script>

Handling by Template Delegate

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

    @(Html.Kendo().ListBox()
        .Name("listbox")
        .Events(e => e.Change(@<text>
                function() {
                    // Handle the ListBox Change event inline.
                }
            </text>)
        )
        ... //Additional configuration
    )
    <kendo-listbox name="listbox" 
        on-change="function() {
            // Handle the ListBox Change event inline.
        }">
    </kendo-listbox>

Next Steps

See Also

In this article