Edit this page

OnSelectedIndexChanged

The selectedIndexChanged event occurs when user changes the checked stated of an item in RadCheckBoxList.

The event handler receives two parameters:

  1. The instance of the loaded RadCheckBoxList control.

  2. An eventArgs parameter of type Telerik.Web.UI.ButtonListSelectedIndexChangedEventArgs, containing the following properties and methods:

    • get_newSelectedIndex() - returns the index of the currently selected item.

Example 1: Handling RadCheckBoxList OnSelectedIndexChanged event.

<script type="text/javascript">
    function OnSelectedIndexChanged(sender, args) {
        var selectedItem = sender.get_items()[args.get_newSelectedIndex()];
        alert("Checked state changed for " + newItem.get_text() + " language.");
    }
</script>

<telerik:RadCheckBoxList runat="server" ID="RadCheckBoxList1">
    <ClientEvents OnSelectedIndexChanged="OnSelectedIndexChanged" />
    <Items>
        <telerik:CheckBoxListItem Text="English" Selected="true" />
        <telerik:CheckBoxListItem Text="German" />
        <telerik:CheckBoxListItem Text="French" />
    </Items>
</telerik:RadCheckBoxList>

See Also