PanelBarItem and content visibility issue

3 posts, 1 answers
  1. Denis Vuyka
    Denis Vuyka avatar
    39 posts
    Member since:
    Oct 2009

    Posted 25 May 2011 Link to this post

    I'm using RadPanelBar from code meaning I create instances of RadPanelBarItem and fill their "Items" collections with my custom controls.
    Everyting works great untill I set the visibility of my control (in RadPanelBarItem) to "Collapsed". It seems that just item's Header is reset but control is still there. I can have a selection border (couple of pixels height), I can select control itself and etc. So it is accessible by end users though without header and occupying some space. When putting visibility back to "Visible" everything is again fine. 
    Is there anything to fix that?

    Update:
    I have attached a screenshot that displays an issue. The RadPanelBarItem contains 6 TextBlock instances where the 1st one has Visibility set to "Collapsed". User still can select the "Collapsed" item though he should not.

    Xaml to reproduce the issue:

    <telerik:RadPanelBar>
          <telerik:RadPanelBarItem Header="Category" IsExpanded="True">
            <TextBlock Text="Item 1"/>
            <TextBlock Text="Item 2" Visibility="Collapsed"/>
            <TextBlock Text="Item 3"/>
          </telerik:RadPanelBarItem>
        </telerik:RadPanelBar>


    Thanks,
    Denis
  2. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 28 May 2011 Link to this post

    Hello Denis,

    Try wrapping the TextBlocks within a RadPanelBarItem and collapsing the RadPanelBarItem.

    <telerik:RadPanelBar VerticalAlignment="Top">
        <telerik:RadPanelBarItem Header="Category" IsExpanded="True">
            <telerik:RadPanelBarItem>
                <telerik:RadPanelBarItem.Header>
                    <TextBlock Text="Item 1" />
                </telerik:RadPanelBarItem.Header>
            </telerik:RadPanelBarItem>
            <telerik:RadPanelBarItem Visibility="Collapsed">
                <telerik:RadPanelBarItem.Header>
                    <TextBlock Text="Item 2" />
                </telerik:RadPanelBarItem.Header>
            </telerik:RadPanelBarItem>
            <telerik:RadPanelBarItem>
                <telerik:RadPanelBarItem.Header>
                    <TextBlock Text="Item 3" />
                </telerik:RadPanelBarItem.Header>
            </telerik:RadPanelBarItem>
        </telerik:RadPanelBarItem>
    </telerik:RadPanelBar>

    Give it a try and let me know if it helps.

    Regards,
    Kiril Stanoev
    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. DevCraft banner
  4. Denis Vuyka
    Denis Vuyka avatar
    39 posts
    Member since:
    Oct 2009

    Posted 30 May 2011 Link to this post

    Thanks Kiril, that makes perfect sense. As I'm using my custom UI control for panel items I have just inherited it from RadPanelBarItem to make everything work as expected.
    Regards,
    Denis
Back to Top