Prevent collapse problem

2 posts, 0 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 17 Aug 2010 Link to this post

    Hi,

    assume the following scenario:
    A panel with four groups.
    The last group should always be visible.
    From the other groups only one at a time should be visible.

    My approach was:
    A panelbar with ExpandMode SingleExpandItem.
    Four panel items - the last with Expanded and PreventCollapse set. (that's the one which should always stay open).
    The first panel item set to Expanded - it shows my initial selection.
    -- By the way this could be another panel to - later I'll set the "initial expanded one" in code behind.
    Anyhow - for simplicity - I do the expand in markup.
    So my panelbar looks like this:
    Snippet created with CBEnhancer
    <telerik:RadPanelBar ID="rpLeft" OnClientItemExpand="OnExpand" runat="server" Width="150" ExpandMode="SingleExpandedItem">
        <Items>
            <telerik:RadPanelItem runat="server" Text="Root1" ChildGroupHeight="120" Expanded="true">
                <Items>
                    <telerik:RadPanelItem runat="server" Text="Child 1_1">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child 1_2">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child 1_3">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child 1_4">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child 1_5">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child 1_6">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child 1_7">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child 1_8" Selected="true">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Text="Root Zwei">
                <Items>
                    <telerik:RadPanelItem runat="server" Text="Child 2_1">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child 2_2">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Text="Root ZweiA">
                <Items>
                    <telerik:RadPanelItem runat="server" Text="Child 2A_1">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child 2A_2">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Text="Root Drei" PreventCollapse="true" Expanded="true">
                <Items>
                    <telerik:RadPanelItem runat="server" Text="Child 3_1">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child 3_2">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child 3_1">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>
    The initial look is exactly what I want.
    BUT - when I select (let's say) the second group the first group doesn't collapse.
    If I (after this) select the third group - the second group collapses (as it should) but the first stays still open.

    I can now manually collapse group one.
    From now on single expand (partially) works.
    There are still side effects.
    Sometimes group panels stay "marked" - although collapsed correctly.
    Sometimes groups stay open (multiple at a time).

    Reproducible - if you click on the "PreventCollapse" - every opening of the following items keeps the currently open group open.
    Example:
    Click on group one - one expanded - all other collapsed - OK.
    Click on the "PreventCollapse" item - nothing happens - OK.
    Click on group two - two expanded - BUT item one stays expanded.
    Click on the "PreventCollapse" item - nothing happens - OK.
    Click on group three - three expands - BUT One and Two stay open.

    Just a note - when I remove the "PreventCollapse" everything works as expected!

    Manfred
  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 20 Aug 2010 Link to this post

    Hello Manfred,

    This scenario should be achieved by using MultipleExpandedItems ExpandMode of the RadPanelBar.
    The behavior that you currently make use of (more than 1 expanded items at a time while SingleExpandedItem) is considered wrong and with the new SP1 for Q2 2010 version of our controls there is a fix rolled out, which will not allow this to happen.

    Using MultipleExpandedItems, you can achieve this by, again setting PreventCollapse to the items you want to remain open at all time and collapse all other items excluding from this number the one triggering the toggle of an item (as a condition for items to expand/collapse in the handler of ClientItemClicked).

    Hope that you understand our concerns to make this fix, and that the proposed solution will work for you!


    Regards,
    Nikolay Tsenkov
    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
Back to Top