Two Questions

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

    Posted 08 May 2008 Link to this post

    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
  2. Answer
    Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 09 May 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 09 May 2008 Link to this post

    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
  5. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 18 May 2008 Link to this post

    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
  6. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 19 May 2008 Link to this post

    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
  7. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 19 May 2008 Link to this post

    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
  8. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 19 May 2008 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017