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

Two Questions

6 Answers 116 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 08 May 2008, 06:25 AM
Dear All,

I have a panelbar with two groups (so far) with items under each group, I want to have only one expanded group. If the user click on one group the other should collapse and vise verse.

What property I should use
, I tried (ExpandMode="SingleExpandedItem"). with no luck

Also, I place this panelbar on an .ascx file,

How do I use Javascript to access the panelbar items properties
... ( I don't have <Body> tag at the .ascx file)

Best regards,
Waleed

6 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 09 May 2008, 09:37 AM
Hello Waleed Seada,

  1. Please check the following example:
    Expand behavior

    Check the "Single Expanded Item" in the list on the right.
  2. You can refer to the following help articles that shows the client object models of the RadPanelBar and RadPanelBarItem objects.

    RadPanelBar Object
    RadPanelBarItem Object
Hope this helps.

Regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Waleed Seada
Top achievements
Rank 2
answered on 09 May 2008, 12:55 PM
Hello Nick,

I used the code behind script and it works fine...
I can accomplish the same behavior for panelbar using the property ExpandMode as follows:
<?xml version="1.0" encoding="utf-16"?>  
<PanelBar ExpandMode="SingleExpandedItem">  
    <Item Expanded="True" Text="Administration" value="100">  
        <Item Text="AVT data" value="101"/>  
        <Item Text="Security" value="102"/>  
        <Item Text="r.a.d.menu" value="103"/>  
    </Item> 
    <Item Text="Reports" value="200">  
        <Item Text="Financial Reports" value="201" /> 
        <Item Text="Charts and Graphs" value="202"/>  
        <Item Text="Analysis Report" value="203"/>  
        <Item Text="Statistics" value="204"/>  
    </Item> 
</PanelBar> 


Thanks for your answer.
Waleed
0
Waleed Seada
Top achievements
Rank 2
answered on 18 May 2008, 08:01 AM
Hello Nick,

Again I have this issue with panelbar.

This time with templete items inside the panelbar, here si the scenario:
I have placed a Panelbar control in a user control, this panelbar contain templete item with radgrid inside.

everything is fine, except this expand behavuior of the panelbar, even I try to set the expandmode properity in the code behind and in the page_load I put this code:
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!IsPostBack)  
            {  
            }  
              
            foreach (RadPanelItem item in NewsPanel.Items)  
            {  
                item.Expanded = false;  
            }  
            NewsPanel.Items[0].Expanded = true;  
            NewsPanel.ExpandMode = PanelBarExpandMode.SingleExpandedItem;  
 
        }  
 

but nothing is working...
here is the aspx script:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DefaultView.ascx.cs" Inherits="TradeWebApp.Controls.DefaultView" %> 
<%@ Register Assembly="telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<telerik:RadPanelBar ID="NewsPanel" runat="server" Width="100%" SkinID="PanelBar" ExpandMode="SingleExpandedItem">  
<CollapseAnimation Duration="100" Type="InSine" /> 
<ExpandAnimation Duration="100" Type="OutSine" /> 
    <Items> 
        <telerik:RadPanelItem Value="PanelItemGrid" Text="Root RadPanelItem1" runat="server">  
            <ItemTemplate> 
            </ItemTemplate> 
        </telerik:RadPanelItem> 
        <telerik:RadPanelItem Value="PanelItem2" Text="Root RadPanelItem2" runat="server">  
            <ItemTemplate> 
                <asp:Button runat="server" ID="button1" /> 
            </ItemTemplate> 
        </telerik:RadPanelItem> 
        <telerik:RadPanelItem Value="PanelItem3" Text="Root RadPanelItem3" runat="server">  
            <ItemTemplate> 
                <asp:Button runat="server" ID="button2" /> 
            </ItemTemplate> 
        </telerik:RadPanelItem> 
    </Items> 
</telerik:RadPanelBar> 
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> 
 

can you advise me what to do ....

Thanks,
Waleed
0
Paul
Telerik team
answered on 19 May 2008, 07:32 AM
Hello Waleed,

I guess there's some misunderstanding here. Let me explain.

You cannot collapse a header panel item with a template. Here's a sample:

Item1
--template
Item2
--template

In this case, you cannot collapse Item1 and Item2.

Here's how the panelbar structure should look as to achieve your goal:

Item1
-- (RadpanelItem without text)
    --template
Item2
-- (RadpanelItem without text)
    --template


Greetings,
Paul
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Waleed Seada
Top achievements
Rank 2
answered on 19 May 2008, 08:47 AM
Hello Paul,

Thanks for your answer
I did this:
<items>\
                <Panelbaritem 1 "This One with Text">\
                    <Items>
                        <Panelbaritem "This One without text">
                            <TempleteItem>
                <Panelbaritem 2 "This One with Text">\
                    <Items>
                        <Panelbaritem "This One without text">
                            <TempleteItem>
                <Panelbaritem 3 "This One with Text">\
                    <Items>
                        <Panelbaritem "This One without text">
                            <TempleteItem>

It works as excepted.
Thanks Paul,
Waleed
0
Waleed Seada
Top achievements
Rank 2
answered on 19 May 2008, 08:53 AM
Hello Paul

I guess the Text value doesn't matter, I try to put text for the nested panelBarItems and still works ....

I guess the solution was to put nested panelbaritems....

Is this correct ...
Waleed

/Edit:

I have to add this, remove the text value for the nested panelbaritems just to make them invisible ...

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