No expand / collapse behavior for 1 level panels

7 posts, 0 answers
  1. Jp Maxwell
    Jp Maxwell avatar
    47 posts
    Member since:
    Apr 2004

    Posted 14 Sep 2010 Link to this post

    Hi, I wonder why a RadPanel set up like this disallow the expand/collapse behavior (1 level)

    <telerik:RadPanelBar runat="server"
        ExpandMode="SingleExpandedItem"
        <Items>
            <telerik:RadPanelItem Text="TEST1">
                <ItemTemplate>
                    TEST1
                </ItemTemplate>                   
            </telerik:RadPanelItem>
            <telerik:RadPanelItem  Text="TEST2">
                <ItemTemplate>
                    TEST2
                </ItemTemplate>
            </telerik:RadPanelItem>               
        </Items>
    </telerik:RadPanelBar>

    I'm binding a object list to a RadPanel but there is no hierarchy on the data, (no parent child, all items on the same level), despite this, I'd need to have each item on a collapsible item. I'm using databinding.

    Is it possible?

    Thanks!
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 15 Sep 2010 Link to this post

    Hello Jp Maxwell,

    This is so because the SingleExpandedItem expand mode allows one and only one Item to be expanded at a time. In other words when you click on an expanded Item it cannot collapse because there will be no expanded Item at all.

    In your case, I think that it would be more convenient to use the FullExpandedItem expand mode. Please try the different modes in this demo to get a better idea of how each one works.

    I hope this helps.

    Greetings,
    Simon
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jp Maxwell
    Jp Maxwell avatar
    47 posts
    Member since:
    Apr 2004

    Posted 15 Sep 2010 Link to this post

    Unfortunately that change doesn't fix my problem.

    <telerik:RadPanelBar ID="RadPanelBar1" runat="server"
        ExpandMode="SingleExpandedItem">
        <Items>
            <telerik:RadPanelItem Text="TEST1">
                <ItemTemplate>
                    TEST1
                </ItemTemplate>                  
            </telerik:RadPanelItem>
            <telerik:RadPanelItem  Text="TEST2">
                <ItemTemplate>
                    TEST2
                </ItemTemplate>
            </telerik:RadPanelItem>              
        </Items>
    </telerik:RadPanelBar>


    Attached you will find an image that shows how the radpanel currently looks like and what I need. I can't add more levels to the panel. I'd need to make the expand / collapse behavior work with a single level as I show on the code snippet. (The restriction is because I'm using databinding for adding items and it's a single level list as I explained on my previous post).

    Thanks!
  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 15 Sep 2010 Link to this post

    Hello Jp Maxwell,

    In SingleExpandedItem you can have only one Item expanded at a time, so if you click on the header of an expanded Item nothing will happen - you need to click on another Item to collapse the first.

    Have you tried setting the ExpandMode property to FullExpandedItem? In this mode the PanelBar works as you expect - you will be able to expand/collapse an Item when only clicking on its header.

    Regards,
    Simon
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Jp Maxwell
    Jp Maxwell avatar
    47 posts
    Member since:
    Apr 2004

    Posted 15 Sep 2010 Link to this post

    Sorry, my bad. There was a copy paste mistake. I'm actually using your suggestion but that changes nothing :(

    This code creates the RadPanel you can see on the attached image I posted before

    <telerik:RadPanelBar ID="RadPanelBar1" runat="server"
        ExpandMode="FullExpandedItem">
        <Items>
            <telerik:RadPanelItem Text="TEST1">
                <ItemTemplate>
                    TEST1
                </ItemTemplate>                 
            </telerik:RadPanelItem>
            <telerik:RadPanelItem  Text="TEST2">
                <ItemTemplate>
                    TEST2
                </ItemTemplate>
            </telerik:RadPanelItem>             
        </Items>
    </telerik:RadPanelBar>

    Thanks!
  7. Jp Maxwell
    Jp Maxwell avatar
    47 posts
    Member since:
    Apr 2004

    Posted 16 Sep 2010 Link to this post

    Any further comment taking into account my previous post? The suggested solution didn't work unfortunately. Thanks!
  8. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 21 Sep 2010 Link to this post

    Hello Jp Maxwell,

    Upon the next look at your code I noticed that you use ItemTemplate. These templates are not expandable/collapsible and that is why setting ExpandMode to FullExpandedItem does not work.

    You can use ContentTemplate instead and also set Height to the PanelBar to make this work.

    Please excuse me for overlooking the code you provided in the first place.

    Kind regards,
    Simon
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017