Hi!
c#:
I woud Like to do something like this:
After filling a RadPanelBar with data usin data binding, I would like to expand one of the panels and select one of the items in this panel based on an id of the item. Items contains my objects, so I can iterate through them and locate the item, but I cannot figure out how to expand the panel containing the value, neither set mye item selected(thus raise an event).
xaml:
<ScrollViewer Margin="0" Padding="0" VerticalScrollBarVisibility="Auto" BorderThickness="0" Grid.Row="1"> |
<StackPanel Margin="0"> |
<StackPanel.Resources> |
<core:HierarchicalDataTemplate x:Key="radServiceEngineerEntry"> |
<StackPanel Orientation="Horizontal"> |
<Forms:ServiceEngineerRepresenter DataContext="{Binding}" HorizontalAlignment="Left" Margin="0,0,0,0" MouseLeftButtonDown="ServiceEngineerRepresenter_MouseLeftButtonDown"/> |
</StackPanel> |
</core:HierarchicalDataTemplate> |
<core:HierarchicalDataTemplate x:Key="radRotationEntry" ItemTemplate="{StaticResource radServiceEngineerEntry}" ItemsSource="{Binding ServiceEngineers}"> |
<StackPanel Orientation="Horizontal"> |
<Forms:RotationRepresenter DataContext="{Binding}"/> |
</StackPanel> |
</core:HierarchicalDataTemplate> |
</StackPanel.Resources> |
<telerikNavigation:RadPanelBar BorderBrush="#9098a3" BorderThickness="1" Margin="5" x:Name="Rotations" ItemTemplate="{StaticResource radRotationEntry}" /> |
</StackPanel> |
</ScrollViewer> |
Rotations.ItemsSource = rotations; |
foreach (RadPanelBarItem rotation in Rotations.Items) |
{ |
rotation.IsExpanded = true; |
} |
But obviously rotation may not be casted to RadPanelBarItem as the items are my own businessobjects.
I need help... :)
/Øyvind