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

PanelBarItem and content visibility issue

2 Answers 46 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Denis Vuyka
Top achievements
Rank 1
Denis Vuyka asked on 25 May 2011, 02:49 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Stanoev
Telerik team
answered on 28 May 2011, 01:18 PM
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
0
Denis Vuyka
Top achievements
Rank 1
answered on 30 May 2011, 07:54 AM
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
Tags
PanelBar
Asked by
Denis Vuyka
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Denis Vuyka
Top achievements
Rank 1
Share this question
or