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

No expand / collapse behavior for 1 level panels

6 Answers 145 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Jp Maxwell
Top achievements
Rank 1
Jp Maxwell asked on 15 Sep 2010, 04:27 AM
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!

6 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 15 Sep 2010, 01:24 PM
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
0
Jp Maxwell
Top achievements
Rank 1
answered on 15 Sep 2010, 02:09 PM
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!
0
Simon
Telerik team
answered on 15 Sep 2010, 02:48 PM
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
0
Jp Maxwell
Top achievements
Rank 1
answered on 15 Sep 2010, 03:30 PM
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!
0
Jp Maxwell
Top achievements
Rank 1
answered on 16 Sep 2010, 02:14 PM
Any further comment taking into account my previous post? The suggested solution didn't work unfortunately. Thanks!
0
Simon
Telerik team
answered on 21 Sep 2010, 12:39 PM
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
Tags
PanelBar
Asked by
Jp Maxwell
Top achievements
Rank 1
Answers by
Simon
Telerik team
Jp Maxwell
Top achievements
Rank 1
Share this question
or