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

RadPanelBar MVVM Binding: enabling RadPanelBarItem

1 Answer 130 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
solutionfactory
Top achievements
Rank 1
solutionfactory asked on 29 Oct 2010, 10:50 AM
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

1 Answer, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 03 Nov 2010, 10:02 AM
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
Tags
PanelBar
Asked by
solutionfactory
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Share this question
or