This example shows the client-side events supported by Telerik PanelBar for ASP.NET MVC.

The panelbar has the following events:

- OnLoad - raised when the component is initialized
- OnSelect (cancellable) - raised when an item gets selected
- OnExpand (cancellable) - raised when the child group of an item gets expanded
- OnCollapse (cancellable) - raised when the child group of an item gets collapsed

You can subscribe to each of the events in the following ways:

- With a pre-defined javascript function

      <%= Html.Telerik().PanelBar()
              .Name("PanelBar")
              .ClientEvents(events => events
                  .OnSelect("onSelect")
              )
      %>

      <script type="text/javascript">
          function onSelect(e) {
              // your code
          }
      </script>

- With an inline function, serialized from the server

      <% Html.Telerik().PanelBar()
             .Name("PanelBar")
             .ClientEvents(events => events
             .OnLoad(() =>
             {%>
                  function(e) {
                      // your code
                  }
             <%})
             .Render();
      %>

- Purely client-side event registration

      <%= Html.Telerik().PanelBar().Name("PanelBar") %>

      <script type="text/javascript">
          $(document).ready(function() {
              $('#PanelBar').bind('select', function(e) {
                  // your code
              });
          });
      </script>