Edit this page

Events Overview

RadRadioButtonList exposes several client-side events that allow easy and flexible use in a wide range of application scenarios:

To handle the desired event, the user must set the respective property to the name of the JavaScript function handling the event or to an anonymous JavaScript function. Here is an example:

Example 1: Passing a named (non-anonymous) JavaScript function.

<script type="text/javascript">
    function OnItemClicked(sender, args) {
        var selectedItem = args.get_item();
        alert(selectedItem.get_text());
    }
</script>

<telerik:RadRadioButtonList runat="server" ID="RadRadioButtonList1">
    <ClientEvents OnItemClicked="OnItemClicked" />
    <Items>
        <telerik:RadioButtonListItem Text="English" Selected="true" />
        <telerik:RadioButtonListItem Text="German" />
        <telerik:RadioButtonListItem Text="French" />
    </Items>
</telerik:RadRadioButtonList>
RadRadioButtonList1.ClientEvents.OnItemClicked = "OnItemClicked";  //passing the name of the JS function
RadRadioButtonList1.ClientEvents.OnItemClicked = "OnItemClicked"  'passing the name of the JS function

Example 2: Passing an anonymous JavaScript function.

<telerik:RadRadioButtonList runat="server" ID="RadRadioButtonList1">
    <ClientEvents OnItemClicked="function(sender,args){var selectedItem = args.get_item(); alert(selectedItem.get_text());}" />
    <Items>
        <telerik:RadioButtonListItem Text="English" Selected="true" />
        <telerik:RadioButtonListItem Text="German" />
        <telerik:RadioButtonListItem Text="French" />
    </Items>
</telerik:RadRadioButtonList>
RadRadioButtonList1.ClientEvents.OnClientClicked = "function(sender,args){var selectedItem = args.get_item(); alert(selectedItem.get_text());}"; //passing an anonymous JS function
RadRadioButtonList1.ClientEvents.OnClientClicked = "function(sender,args){var selectedItem = args.get_item(); alert(selectedItem.get_text());}"  'passing an anonymous JS function

See Also