RadPanelBar MVVM Binding: enabling RadPanelBarItem

2 posts, 0 answers
  1. solutionfactory
    solutionfactory avatar
    45 posts
    Member since:
    Apr 2007

    Posted 29 Oct 2010 Link to this post

    Hello,
    I'm using the RadPanelBar in an application who use the MVVM pattern with the following binding on the ItemSource property:

    <telerikNavigation:RadPanelBar Grid.Row="1" Margin="10" telerik:StyleManager.Theme="Windows7" x:Name="pbPanels"
                ItemsSource="{Binding NavigationsPanelItems}"
                SelectedItem="{Binding SelectedPanelItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
    DisplayMemberPath="DisplayName">
            </telerikNavigation:RadPanelBar>
    <telerikNavigation:RadPanelBar Grid.Row="1" Margin="10" telerik:StyleManager.Theme="Windows7" x:Name="pbPanels"
                ItemsSource="{Binding NavigationsPanelItems}"
                SelectedItem="{Binding SelectedPanelItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                DisplayMemberPath="DisplayName">
    </telerikNavigation:RadPanelBar>

    with a hierarchicaldatatemplate:

    <HierarchicalDataTemplate DataType="{x:Type vm:TPNavigationGeneralInfoViewModel}"
                        ItemTemplate="{StaticResource pbiGeneralInfoTemplate}" ItemsSource="{Binding PanelBarContent}">
                    <TextBlock Text="{Binding DisplayName}" Height="20" Margin="5 2 5 2" FontWeight="Bold" FontSize="16"/
    </HierarchicalDataTemplate>

    where the ItemTemplate is a custom UserControl.

    I need to bind the property IsEnabled of each one of the PanelBarItems inside the collection, but I'm not able to do that. Can you please give me some hints?

    Thanks,
    Flavio
  2. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 03 Nov 2010 Link to this post

    Hello fcometto,

     You can bind the generated RadPanelBarItems to the object behind that using the so called ContainerBindings (Read the full story.) This is fixed for the limitation in Silverlight that doesn't allow you to have Bindings in style.
    Hope will help you.

    All the best,
    Miro Miroslavov
    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. UI for WPF is Visual Studio 2017 Ready
Back to Top