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

PanelBarItem and Visibility.Collapsed

2 Answers 65 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Jacob
Top achievements
Rank 1
Jacob asked on 29 Oct 2010, 08:05 PM
Hello all,

I'm playing with the Silverlight demo controls, particularly the RadPanelBar. I want to be able to hide RadPanelBarItems, but when an expanded PanelBarItem's Visibility is set to Collapsed, that PanelBarItem still takes up space. I'd expect that PanelBarItem to no longer be included in layout, per the MSDN description.

A very simple repro case is below. When I view this control in my browser, I expect the two visible PanelBarItems to be displayed at the top of the PanelBar. Instead, they are displayed at the bottom, as if the collapsed PanelBarItem is still there. Is this expected behavior?

<UserControl
    mc:Ignorable="d"
    x:Class="SilverlightApplication1.PanelBar"
    d:DesignWidth="640" d:DesignHeight="480">
 
    <Grid x:Name="LayoutRoot" Background="White">
        <telerik:RadPanelBar VerticalAlignment="Stretch">
            <telerik:RadPanelBarItem Header="RadTreeViewItem" IsExpanded="True" Visibility="Collapsed">
                <telerik:RadPanelBarItem Header="RadTreeViewItem"/>
            </telerik:RadPanelBarItem>
            <telerik:RadPanelBarItem Header="RadTreeViewItem">
                <telerik:RadPanelBarItem Header="RadTreeViewItem"/>
            </telerik:RadPanelBarItem>
            <telerik:RadPanelBarItem Header="RadTreeViewItem">
                <telerik:RadPanelBarItem Header="RadTreeViewItem"/>
            </telerik:RadPanelBarItem>
        </telerik:RadPanelBar>
    </Grid>
</UserControl>

Thanks,
Jacob Champion

2 Answers, 1 is accepted

Sort by
0
Accepted
Miro Miroslavov
Telerik team
answered on 03 Nov 2010, 12:44 PM
Hi Jacob,

 This is know issue with the RadTreeView, but since the RadPanelBar inherits from it - it gets it as well. The problem is caused by the default virtualizing panel, but you can fix it pretty easily by changing the ItemsPanel

<ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
        <StackPanel/>
    </ItemsPanelTemplate>
 
<telerik:RadPanelBar VerticalAlignment="Stretch" ItemsPanel="{StaticResource ItemsPanelTemplate1}">

Hope this will help you.

All the best,
Miro Miroslavov
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
Jacob
Top achievements
Rank 1
answered on 03 Nov 2010, 06:51 PM
Miro,

That's exactly the behavior I was looking for. Thank you!

Jacob Champion
Tags
PanelBar
Asked by
Jacob
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Jacob
Top achievements
Rank 1
Share this question
or