RadToolBar for ASP.NET AJAX

RadControls for ASP.NET AJAX

The OnClientCheckedStateChanging client-side event occurs before a button has been checked.

Caution

To check a button it should be marked with CheckOnClick="True"

The event handler receives two parameters:

  1. The instance of the toolbar firing the event.
  2. An eventArgs parameter containing the following methods:
    • get_item returns a reference to the toolbar item that was checked. In this case this is a RadToolBarButton
    • set_cancel lets you prevent the drop-down from checking
    • get_domEvent returns the browser's event object

You can use this event to respond when a button has been checked.

CopyASPX
<script type="text/javascript">
    function checkedStateChanging(sender, args) {
        args.set_cancel(true);
    }        
</script> 
<telerik:RadToolBar ID="RadToolBar1" runat="server" OnClientCheckedStateChanging="checkedStateChanging">    
<Items>        
    <telerik:RadToolBarButton Text="Button1" CheckOnClick="true">
    </telerik:RadToolBarButton>        
    <telerik:RadToolBarButton Text="Button1" CheckOnClick="true">
    </telerik:RadToolBarButton>        
    <telerik:RadToolBarButton Text="Button1" CheckOnClick="true">
    </telerik:RadToolBarButton>    
</Items>
</telerik:RadToolBar>