Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > PanelBar > Automatically expand the panelbar

Not answered Automatically expand the panelbar

Feed from this thread
  • Sathish avatar

    Posted on Dec 15, 2011 (permalink)

    Hi,

    I am new to using Telerik controls
     
    Requirement
    • I am having two header panel (Customer,Salary)
    • under that many items are displaying without any issue
    • i want to collapse/expand the Customer header panel and it's items as a default selection when the page is loaded. 

    For More details please see the attached image the Breverage header should be automatically collapsed like that i need...

          
    How to acheive this.
    My code is as below

    <HierarchicalDataTemplate x:Key="availablePresetsTemplate" ItemsSource="{Binding Values}"
                                                ItemTemplate="{StaticResource presetTemplate}">          
    <TextBlock Text="{Binding Path=Name}"/>            
    </HierarchicalDataTemplate>
      
    <telerik:RadPanelBar 
                x:Name="panelBar"
                Grid.Column="0" Grid.Row="1"            
                SelectionMode="Extended"
               IsLoadOnDemandEnabled="True"
                ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                ItemsSource="{Binding AvailableRoles}"
                ItemTemplate="{StaticResource availablePresetsTemplate}"
                HorizontalAlignment="Stretch"/>

     

    Thanks in Advance..

    Attached files

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Dec 20, 2011 (permalink)

    Hi Sathish,

    As I managed to understand you need to have particular Items in the RadPanelBar selected and expanded initially. In its core, the RadPanelBar inherits from RadTreeView, so you can take advantage of the telerik's ContainerBindingCollection and bind the IsExpanded and/or IsSelected properties of the RadPanelBarItem / RadTreeViewItem to boolean properties from your ViewModels. Please check out this help article showing how to achieve this. 

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Trish avatar

    Posted on Jan 3, 2012 (permalink)

    The ContainerBindingCollection is only available in Silverlight.  How would you do it in WPF?

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Jan 6, 2012 (permalink)

    Hello Trish,

     Please excuse me for providing a Silverlight tips instead of WPF's ones. In WPF, you use Style Bindings like so:

    <Style x:Key="ItemContainerStyle" TargetType="{x:Type telerik:RadTreeViewItem}">
        <Setter Property="IsSelected" Value="{Binding Path=Selected}"/>
        <Setter Property="IsExpanded" Value="{Binding Path=Expanded}"/>
    </Style>
    The following hep article is analogоus to the mentioned SL's one.
    On a side note, please also keep in mind that Style bindings are now possible in Silverlight 5. 

    All the best,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > PanelBar > Automatically expand the panelbar
Related resources for "Automatically expand the panelbar"

WPF PanelBar Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]