WrapPanel inside RadPanelBar?

4 posts, 0 answers
  1. Jason
    Jason avatar
    2 posts
    Member since:
    Dec 2010

    Posted 02 Dec 2010 Link to this post

    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?
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 06 Dec 2010 Link to this post

    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
  3. DevCraft banner
  4. Jason
    Jason avatar
    2 posts
    Member since:
    Dec 2010

    Posted 06 Dec 2010 Link to this post

    Works perfectly! Thank you SO much!
  5. Wolfgang Kaiser
    Wolfgang Kaiser avatar
    9 posts
    Member since:
    Dec 2009

    Posted 04 Nov 2011 Link to this post

    This sample was extremely helpful to me as well.  Thanks much.
Back to Top