panel stopped expanding

6 posts, 1 answers
  1. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 25 Nov 2009 Link to this post

    I have a panelbar on a usercontrol that fill it's items from an xml file, it has the ExpandMode="SingleExpandedItem".
    when I implement the onitemclick server side event with "navpanelBar_ItemClick" event handler the panel stopped expanding ..

    Is there a reason for that .

    below is the code of this

     

     

    <telerik:RadPanelBar ID="navpanelBar" Runat="server"   
        ExpandMode="SingleExpandedItem" Width="100%"   
        OnClientItemClicking="panelclicking" onitemclick="navpanelBar_ItemClick" > 
    </telerik:RadPanelBar> 
       
     <script type="text/jscript" language="javascript">  
        function panelclicking(sender, e)  
        {  
            var itemval = e.get_item().get_value();  
            if (!itemval)  
            {e.set_cancel(true);    }  
            else   
            {e.set_cancel(false);}  
        }  
    </script> 

    Thanks in advance

  2. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 01 Dec 2009 Link to this post

    Hello Guys,

    Let me re-phrase this.

    My requirement is to have panelbar with panelitems that will load different UC, I want to be able to do that only when an item is clicked not for the panelbar group header.

    I have this for the panelbar tag:
    <telerik:RadPanelBar ID="navpanelBar" Runat="server"   
        ExpandMode="SingleExpandedItem" Width="100%"   
        onitemclick="navpanelBar_ItemClick" > 
    </telerik:RadPanelBar> 

    this is the implementation for the navpanelBar_ItemClick
    protected void navpanelBar_ItemClick(object sender, Telerik.Web.UI.RadPanelBarEventArgs e)  
            {  
                Telerik.Web.UI.RadPanelItem raditem = e.Item;  
                  
                if (raditem.Value == ""return;  
                  
                switch (raditem.Value)  
                {  
                    case "100":  
                        //Load UC 1;  
                        break;  
                    case "101":  
                        ''Load UC 2  
                        break;  
                    default:  
                        return;  
                }  
            } 

    What really happens is that the panel postback on every click to the group or item.

    Any Help !!
    Waleed

    Edited:
    I forgot to add that this panelbar is ajaxified with an ASP:Panel which hosts the loaded UC.
    If I click on group it will not expand until a make an explicit postback (via  a button on the master page)

    Regards
    Waleed
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 04 Dec 2009 Link to this post

    Hi Waleed,

    You should create a new RadPanelBarItem and add the user control to it, after that add this item to the clicked item to fix the expanding problem. Please try it and let us know how it goes.

    Best regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 05 Dec 2009 Link to this post

    Hello Yana,

    You mis-understood me, maybe something wrong with my post.
    The User controls is loaded when panelbaritem get clicked by calling a function on the master-page that host the panelbar and another asp-panel which is the target for the loaded controls not the panelbar itself.

    This describe the situation shortly.

    This ticket has an attached example of the issue: http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=261770

    Regards
    Waleed
  6. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 10 Dec 2009 Link to this post

    Hi Waleed,

    I've tested your project from 12/03  - "PanelBarIssue" and the panelbar is not expanded, because of the ajax settings of the ajax manager.  Please modify them in Page_Load method of Score.Master.cs like this:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (CurrentControl != string.Empty)
        {
            LoadUserControl(CurrentControl, MainPanel);
        }
        RadManager.AjaxSettings.AddAjaxSetting(NavPanel, MainPanel, LoadingPanel1);
        RadManager.AjaxSettings.AddAjaxSetting(NavPanel, lblmsg, LoadingPanel1);
      RadManager.AjaxSettings.AddAjaxSetting(NavPanel, NavPanel, LoadingPanel1);
    }

    Basically, the panelbar should be set to update itself in order to be able to expand.


    Best regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 10 Dec 2009 Link to this post

    Dear Yana,

    Very Healpful Indeed !!! You made my day !!

    I would give you 1000,000 point if I could.

    Best regards
    Waleed
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017