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

RadPanelBar ItemsTemplate issue

5 Answers 185 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
haider aslam
Top achievements
Rank 1
haider aslam asked on 05 Mar 2010, 11:52 AM
Hi,
    I am using a RadPanelBar in a SL application. When i place a 'view' inside the panelbar it is displayed within the header of the panelbar., instead of appearing as a RadPaneBarltem!Following is the xaml code i used:

<telerikNavigation:RadPanelBar x:Name="radPanel" ItemsSource="(Binding Binder, Mode=TwoWay)"  MinHeight="340" Background="#FFF8F8F8" Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" ExpandMode="Single" Grid.Row="1" >
                    <telerikNavigation:RadPanelBar.ItemTemplate>
                        <DataTemplate>
                            <local:CreateWorkCodeStepsView/>
                        </DataTemplate>
                    </telerikNavigation:RadPanelBar.ItemTemplate>
                </telerikNavigation:RadPanelBar>

Please see the JPG file for further clarity!

5 Answers, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 05 Mar 2010, 01:34 PM
Hi Haider,

What you observed is the expected behavior of the control. The PanelBar is a hierarchical control and each of its items has a header and a collection of subitems - thus, you shouldn't expect an item to have a content other than what is displayed in its header. If your data is not hierarchical, probably our OutlookBar or Expander controls will be better suited to your scenario. Please take a look at the links below and let me know if any of these controls will fit your needs.

http://demos.telerik.com/silverlight/#OutlookBar/FirstLook
http://demos.telerik.com/silverlight/#Expander/FirstLook

If you insist on using the PanelBar for displaying non intrinsically hierarchical data, this is still possible but would require some re-templating of the control, since this is not specifically the type of scenario it is intended for.

All the best,
Tihomir Petkov
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
haider aslam
Top achievements
Rank 1
answered on 05 Mar 2010, 02:14 PM
Thanks for your reply. Actually i want functionality similar to the accordion as shown at:
http://demos.telerik.com/silverlight/#PanelBar/Accordion

I want a 'UserControl' to be displayed as a RadPanelBarItem!
0
Tihomir Petkov
Telerik team
answered on 08 Mar 2010, 01:40 PM
Hi Haider,

In that case, you will need to use a HierarchicalDataTemplate. I prepared a sample project that demonstrates how to do that. Please take a look at it and let meknow if it helps.

Regards,
Tihomir Petkov
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
Bas
Top achievements
Rank 1
answered on 21 Nov 2011, 09:17 PM
Hi,

I wanted to use the radpanelbar in exactly the same scenario as Haider and basicly ran into the same problem, which I might add was a bit of a surprise. Logical it would be to add the RadPanelBarItem in the template. Yet your example project got me started with working around it. Yet, I've run into the next problem. I need to set the IsExpanded flag on the individual RadPanelBarItem since it is not represented in the itemtemplate I wondered how i could achieve this? Could you please modify the given project and show us how to modify the the properties of the RabPanelBarItem while still building the collection dynamicly?

tx
0
Stefan
Telerik team
answered on 24 Nov 2011, 05:04 PM
Hello Teus,

In order to set the RadPanelBarItem's IsExpanded property to True when the RadPanelBarItems are generated dynamicly you can use telerik's ContainerBindings, where you can bind the IsExpanded property  to a boolean propety from your ViewModel.

I have updated the project which was previously attached and if you have more questions on the topic feel free to contact us.

Best wishes,
Stefan
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
PanelBar
Asked by
haider aslam
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
haider aslam
Top achievements
Rank 1
Bas
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or