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

WrapPanel inside RadPanelBar?

3 Answers 108 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 02 Dec 2010, 05:05 PM
For our application we would like to use WrapPanels within a RadPanelBar to create a SmartPhone look. We've looked at the samples online and searched the forums but are having trouble figuring this out. (We were hoping for a property like ItemsPanel/ItemsPanelTemplate we could override.)

We are employing the MVVM pattern and have figured out data binding with HierarchicalDataTemplate, ContainerBindingCollection etc. The WrapPanel is the last piece of the puzzle.

Anyone know how to pull this off?

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 06 Dec 2010, 07:19 PM
Hi Jason,

You can use the ItemContainerStyle property of the RadPanelBar and set the ItemsPanel of the RadPanelBarItems  to contain a RadWrapPanel:
<UserControl.Resources>
 
    <!--...-->
 
    <ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
        <telerik:RadWrapPanel HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch" />
    </ItemsPanelTemplate>
 
    <Style x:Key="containerStyle"
            TargetType="telerikNavigation:RadPanelBarItem">
        <Setter Property="ItemsPanel"
                Value="{StaticResource ItemsPanelTemplate1}" />
    </Style>
 
    <!--...-->
 
</UserControl.Resources>
 
<Grid x:Name="LayoutRoot"
        Background="LightGray">
 
    <telerikNavigation:RadPanelBar ScrollViewer.HorizontalScrollBarVisibility="Disabled"
          ItemContainerStyle="{StaticResource containerStyle}"
          Background="White"
          VerticalAlignment="Stretch"
          ExpandMode="Single"
          ItemsSource="{Binding Manifest.Categories}"
          ItemTemplate="{StaticResource categoryTemplate}" />
 
</Grid>

Feel free to ask if you need further assistance.

All the best,
Tina Stancheva
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Jason
Top achievements
Rank 1
answered on 06 Dec 2010, 09:01 PM
Works perfectly! Thank you SO much!
0
Wolfgang Kaiser
Top achievements
Rank 1
answered on 04 Nov 2011, 04:18 PM
This sample was extremely helpful to me as well.  Thanks much.
Tags
PanelBar
Asked by
Jason
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Jason
Top achievements
Rank 1
Wolfgang Kaiser
Top achievements
Rank 1
Share this question
or