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

Events

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

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

Handling by Handler Name

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

    @(Html.Kendo().RadioGroup()
        .Name("radiogroup")
        .Items(i =>
        {
            i.Add().Label("Two bedroom apartment for multiple people").Value("1");
            i.Add().Label("Studio apartment with kitchen").Value("2");
            i.Add().Label("Double bed apartment with kids zone").Value("3");
        })
        .Value("2")
        .Events(e => e.Change("onChange"))
    )
        <kendo-radiogroup name="radiogroup" on-change="onChange"
                          radio-name="radiogroup"    
                          value="2">
            <kendo-radiogroup-items>
                <kendo-radiogroup-item label="Two bedroom apartment for multiple people" value="1"></kendo-radiogroup-item>
                <kendo-radiogroup-item label="Studio apartment with kitchen" value="2"></kendo-radiogroup-item>
                <kendo-radiogroup-item label="Double bed apartment with kids zone" value="3"></kendo-radiogroup-item>
            </kendo-radiogroup-items>
        </kendo-radiogroup>
    <script>
        function onChange() {
            // Handle the change event.
        }
    </script>

Handling by Template Delegate

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

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

Next Steps

See Also

In this article