RadPanelBar ItemsTemplate issue

6 posts, 0 answers
  1. haider aslam
    haider aslam avatar
    11 posts
    Member since:
    Jan 2010

    Posted 05 Mar 2010 Link to this post

    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!
  2. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 05 Mar 2010 Link to this post

    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.
  3. DevCraft banner
  4. haider aslam
    haider aslam avatar
    11 posts
    Member since:
    Jan 2010

    Posted 05 Mar 2010 Link to this post

    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!
  5. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 08 Mar 2010 Link to this post

    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.
  6. Paul
    Paul avatar
    1 posts
    Member since:
    Oct 2011

    Posted 21 Nov 2011 Link to this post

    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
  7. Stefan
    Admin
    Stefan avatar
    89 posts

    Posted 24 Nov 2011 Link to this post

    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 >>
Back to Top
DevCraft banner