RadPanelBar and SingleExpandedItem vs. FullExpandedItem

3 posts, 0 answers
  1. Chris
    Chris avatar
    3 posts
    Member since:
    Oct 2011

    Posted 03 Mar 2012 Link to this post

    I'm trying to set up a panel bar that has the size restrictions of FullExpandedItem, but the behavior for child items of SingleExpandedItem (only one item within a group expanded at a time)

    I can come really close by using FullExpandedItem, and using OnClientItemClicking where the function collpapses all the peers of of the item being clicked (if level isn't 0) and it works perfectly....unless you click on the expandhandle.

    In that case, the OnClientItemClicking function is never called.

    How can I either get a chance to handle the click when the expandhandle is called, or implement this whole thing a different way?
  2. Chris
    Chris avatar
    3 posts
    Member since:
    Oct 2011

    Posted 04 Mar 2012 Link to this post

    FWIW, this seems to be working for me:

    <script type="text/javascript">
      function OnClientItemClicking(sender, eventArgs) {
        var item = eventArgs.get_item();
        if (item.get_level() != 0) { //level 0 handled by FullExpandedItem mode
          if (item.get_items().get_count() != 0) {
            var parent = item.get_parent();
            for (i = 0; i < parent.get_items().get_count(); ++i) {
              var node = parent.get_items().getItem(i);
              if ((node != item) && node.get_expanded()) {
      var old_onExpandHandleClick = Telerik.Web.UI.RadPanelItem.prototype._onExpandHandleClick;
      Telerik.Web.UI.RadPanelItem.prototype._onExpandHandleClick = function (element) {
        var panel = this.get_panelBar();
        var clickingArgs = new Telerik.Web.UI.RadPanelItemClickingEventArgs(this, element);
        panel._raiseEvent("itemClicking", clickingArgs);
        return old_onExpandHandleClick.apply(this, arguments);
     I know it's not a general purpose solution, but given my situation:  radpanelbar in FullExpandedItem mode, and the OnClientClicking function never tries to cancel the click, it seems to work.  So far.

    Question to Telerik:  would it be worthwhile to open a support ticket that clicking the expandhandle does not raise the itemClicking event?
  3. DevCraft R3 2016 release webinar banner
  4. Kate
    Kate avatar
    1898 posts

    Posted 07 Mar 2012 Link to this post

    Hi Chris,

    Indeed no event fires when you click on the expand handler of a RadPanelItem. We are already aware of this issue and it is already logged in our PITS. Below is the link where you can vote and keep track on its status:

    All the best,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top