I have my RadPanelBar set up as below
<
UserControl.Resources>
<core:HierarchicalDataTemplate x:Name="fieldCollectionTemplate" ItemsSource="{Binding fieldCollection}">
<StackPanel Orientation="Vertical" x:Name="stackPanelForControls">
<local:SearchFieldControl/>
</StackPanel>
</core:HierarchicalDataTemplate >
</UserControl.Resources>
<Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource SampleFile}}">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<telerikNavigation:RadPanelBar HorizontalAlignment="Left" Margin="8,64,0,32" VerticalAlignment="Stretch" Width="240"
ItemsSource="{Binding FieldGroupCollection}" x:Name="searchPanel" Grid.Row="0" IsTextSearchEnabled="True">
<telerikNavigation:RadPanelBar.ItemTemplate>
<core:HierarchicalDataTemplate ItemsSource="{Binding fieldCollection}"
ItemTemplate="{StaticResource fieldCollectionTemplate}">
<TextBlock Text="{Binding Name}" Foreground="Blue" />
</core:HierarchicalDataTemplate>
</telerikNavigation:RadPanelBar.ItemTemplate>
</telerikNavigation:RadPanelBar>
<!--<Button x:Name="btnLoad" Grid.Row="1" Height="50" Width="80" HorizontalAlignment="Left" Content="Load Data"/>-->
<core:RadButton HorizontalAlignment="Left" Margin="48,0,0,6" VerticalAlignment="Bottom" Content="RadButton" x:Name="btnLoad" Click="btnLoad_Click" />
</Grid>
</
UserControl>
I have Created a Search userControl which has a text Box and a ContentControl inside it.
I need to dynamically go and set the ContentControl in the Search User Control to a Combo Box, Date or checkbox , on a click of a button, but given the template I have, I am not sure, How I can Iterate through the RadPanel Bar to set the contentControl within the UserControl which is a part of the heirarchical DataTemplate. Please advice.