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

RadPanelBar item indentation and vertical size

3 Answers 134 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 16 Nov 2016, 02:35 PM

I'm using a RadPanelBar as a categorized menu, where the headers are the categories and the children of the headers are the menu items.  If you look at the screenshot of the RadPanelBar in your documentation at http://docs.telerik.com/devtools/wpf/controls/radpanelbar/structure, that's pretty much what I want it to look like. 

However, using the latest version (R3 2016), a basic RadPanelBar looks very different from the screenshot in your documentation.  I've attached a screen shot and here is my xaml:

                <telerik:RadPanelBar Grid.Row="1" ExpandMode="Multiple" >
                    <telerik:RadPanelBarItem Header="Security" IsExpanded="True">
                        <TextBlock Text="Rights By User" />
                        <TextBlock Text="Rights By Right" />
                    </telerik:RadPanelBarItem>
                </telerik:RadPanelBar>

The differences I don't like are (1) the items are indented by what looks like about 60px, and (2) the items stretch to fill the available vertical space.  I want the items to not be indented and to be their natural height, as they are in your screen shot. 

I'm using the VisualStudio2013 theme, which might account for the difference.  If that's it, could you give me some guidance on where that margin/padding that causes the indent is coming from?  I've skimmed the templates in the theme and didn't see it.

 

3 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 21 Nov 2016, 08:24 AM
Hello Patrick,

In order to define the RadPanelbar to only take so much space as it needs, you will need to set the VerticalAlignment property to be different than Stretch (Top for example), since by default this property is Stretch thus causing the RadPanelBar and its children to fill the available space. Take a look at the following code snippet.

<telerik:RadPanelBar Grid.Row="1" ExpandMode="Multiple" VerticalAlignment="Top">
    <telerik:RadPanelBarItem Header="Security" IsExpanded="True">
        <TextBlock Text="Rights By User" />
        <TextBlock Text="Rights By Right" />
    </telerik:RadPanelBarItem>
</telerik:RadPanelBar>


Regards,
Dinko
Telerik by Progress
Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
0
Patrick
Top achievements
Rank 1
answered on 23 Nov 2016, 11:14 AM

Hi,

I haven't tried it yet, but I doubt that will produce the results I'm looking for.  I want the RadPanelBar to fill the height of its container.  The problem I'm having is with the items inside the RadPanelBar filling the height of the RadPanelBar.  The behavior I'm looking for is really more like a grouped list box with expandable/collapsible groups.

Thx,

Pat

0
Dinko | Tech Support Engineer
Telerik team
answered on 28 Nov 2016, 08:13 AM
Hello Patrick,

Thank you for clarifying your question.

You can create an Implicit custom style which target type is set to :RadPanelBarItem.  Then you can set the VerticalAlignment property of the RadPanelBarItem to Top. I have created sample project demonstrating this approach. Give it a try and let me know if it works for you.

Regards,
Dinko
Telerik by Progress
Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
Tags
PanelBar
Asked by
Patrick
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Patrick
Top achievements
Rank 1
Share this question
or