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

PanelBarItem not showing expand/collapse icon on second level

1 Answer 86 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Rod
Top achievements
Rank 1
Rod asked on 16 Aug 2016, 01:49 PM

Can anyone tell me how to get the second level items to behave like the first level items? I would expect any level that has children to show an expander. In my example, the Send Items header should have an expander icon.

 

<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:Calendar="clr-namespace:Telerik.Windows.Controls.Calendar;assembly=Telerik.Windows.Controls.Input" xmlns:Chromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls"
xmlns:Animation="clr-namespace:Telerik.Windows.Controls.Animation;assembly=Telerik.Windows.Controls.Navigation"
x:Class="WpfApplication2.MainWindow"
Title="MainWindow" Height="500" Width="525">
<Window.Resources>
</Window.Resources>
<Grid>
<telerik:RadPanelBar Margin="10" Width="280" Height="300">
<telerik:RadPanelBarItem Header="Mail">
<telerik:RadPanelBarItem Header="Personal Folder" />
<telerik:RadPanelBarItem Header="Delete Items" />
<telerik:RadPanelBarItem Header="Inbox" />
<telerik:RadPanelBarItem Header="Send Items" >
<telerik:RadPanelBarItem Header="Personal Folder" />
<telerik:RadPanelBarItem Header="Delete Items" />
<telerik:RadPanelBarItem Header="Inbox" />
<telerik:RadPanelBarItem Header="Send Items" />
<telerik:RadPanelBarItem Header="OutBox" />
<telerik:RadPanelBarItem Header="Search Folders" />
</telerik:RadPanelBarItem>
<telerik:RadPanelBarItem Header="OutBox" />
<telerik:RadPanelBarItem Header="Search Folders" />
</telerik:RadPanelBarItem>
<telerik:RadPanelBarItem Header="Contacts">
<telerik:RadPanelBarItem Header="My Contacts" />
<telerik:RadPanelBarItem Header="Address Cards" />
<telerik:RadPanelBarItem Header="Phone List" />
<telerik:RadPanelBarItem Header="Shared Contacts" />
</telerik:RadPanelBarItem>
<telerik:RadPanelBarItem Header="Tasks">
<telerik:RadPanelBarItem Header="My Tasks" />
<telerik:RadPanelBarItem Header="Shared Tasks" />
<telerik:RadPanelBarItem Header="Active Tasks" />
<telerik:RadPanelBarItem Header="Completed Tasks" />
</telerik:RadPanelBarItem>
<telerik:RadPanelBarItem Header="Notes">
<telerik:RadPanelBarItem Header="My Notes" />
<telerik:RadPanelBarItem Header="Notes List" />
<telerik:RadPanelBarItem Header="Shared Notes" />
<telerik:RadPanelBarItem Header="Archive" />
</telerik:RadPanelBarItem>
<telerik:RadPanelBarItem Header="Folders List">
<telerik:RadPanelBarItem Header="My Client.Net" />
<telerik:RadPanelBarItem Header="My Profile" />
<telerik:RadPanelBarItem Header="My Support Tickets" />
<telerik:RadPanelBarItem Header="My Licenses" />
</telerik:RadPanelBarItem>
</telerik:RadPanelBar>
</Grid>
</Window>

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 17 Aug 2016, 07:22 AM
Hi Rod,

The RadPanelBar supports only two levels of items. Any items defined deeper in the hierarchy won't be rendered. To achieve your requirement you can use RadTreeView instead of RadPanelBar, and style its nodes so that it looks as the panelbar. 

Another approach is to use RadTreeView in the RadPanelBarItem that you want to be expandable. For example:
<telerik:RadPanelBarItem>
    <telerik:RadPanelBarItem.Header>
        <telerik:RadTreeView>
            <telerik:RadTreeViewItem Header="Send Items">
                <telerik:RadTreeViewItem Header="Personal Folder" />
                <telerik:RadTreeViewItem Header="Delete Items" />
                <telerik:RadTreeViewItem Header="Inbox" />
                <telerik:RadTreeViewItem Header="Send Items" />
                <telerik:RadTreeViewItem Header="OutBox" />
                <telerik:RadTreeViewItem Header="Search Folders" />
            </telerik:RadTreeViewItem>
        </telerik:RadTreeView>
    </telerik:RadPanelBarItem.Header>
</telerik:RadPanelBarItem>

Regards,
Martin
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
PanelBar
Asked by
Rod
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or