This is a migrated thread and some comments may be shown as answers.

panel stopped expanding

5 Answers 87 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Waleed Seada
Top achievements
Rank 2
Waleed Seada asked on 25 Nov 2009, 06:14 AM
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

5 Answers, 1 is accepted

Sort by
0
Waleed Seada
Top achievements
Rank 2
answered on 02 Dec 2009, 05:51 AM
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
0
Yana
Telerik team
answered on 04 Dec 2009, 03:27 PM
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.
0
Waleed Seada
Top achievements
Rank 2
answered on 05 Dec 2009, 07:07 PM
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
0
Accepted
Yana
Telerik team
answered on 10 Dec 2009, 09:20 AM
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.
0
Waleed Seada
Top achievements
Rank 2
answered on 10 Dec 2009, 12:58 PM
Dear Yana,

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

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

Best regards
Waleed
Tags
PanelBar
Asked by
Waleed Seada
Top achievements
Rank 2
Answers by
Waleed Seada
Top achievements
Rank 2
Yana
Telerik team
Share this question
or