Hi,
I am working on dynamic loading of RadPanelBar Control. I am having a collections where 2 levels of topics would be there
The data would be in the below format
Id Name ParentCategoryID LEVEL
19741 A 19737 1
19749 B 19737 1
19750 C 19749 2
19772 D 19749 2
19742 E 19741 2
19743 F 19741 2
19744 G 19741 2
I want to bind the Level 1 data in the parent level and Level 2 data with whose parentid matches with the id will be displayed as the child level
Eg) A and B are at the parent levels.
C,D will be displayed under B and E,F,G will be displayed under A
I created the following template to display this
I am getting the topics correctly and I was not able to filter the second level elements since the selecteditem for RadPanelBar always return null values(I'm using MVVM model). Also I was not able to expand the radpanelbar items in design. Should i need to add code for that? i want to expand the selected element. please respond me asap.
Regards,
R.Saranya.
I am working on dynamic loading of RadPanelBar Control. I am having a collections where 2 levels of topics would be there
The data would be in the below format
Id Name ParentCategoryID LEVEL
19741 A 19737 1
19749 B 19737 1
19750 C 19749 2
19772 D 19749 2
19742 E 19741 2
19743 F 19741 2
19744 G 19741 2
I want to bind the Level 1 data in the parent level and Level 2 data with whose parentid matches with the id will be displayed as the child level
Eg) A and B are at the parent levels.
C,D will be displayed under B and E,F,G will be displayed under A
I created the following template to display this
<telerik:RadPanelBar x:Name="pnlTopic" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" ExpandMode="Single" telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True" ItemsSource="{Binding Topics}" SelectedItem="{Binding SelectedTopic}"> <telerik:RadPanelBar.ItemTemplate> <DataTemplate> <telerik:RadPanelBarItem Header="{Binding Name}" IsSelected="True" IsExpanded="{Binding DataContext.IsExpanded,ElementName=pnlTopic}" x:Name="pnliTopic" > <ListBox x:Name="lstSubTopics" ItemsSource="{Binding DataContext.SubTopics,ElementName=pnlTopic}"> <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Name}" Margin="2" FontWeight="SemiBold" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </telerik:RadPanelBarItem> </DataTemplate> </telerik:RadPanelBar.ItemTemplate> <i:Interaction.Triggers> <i:EventTrigger EventName="SelectionChanged"> <i:InvokeCommandAction Command="{Binding AccordionSelectionChange}" CommandParameter="{Binding Item}"/> </i:EventTrigger> </i:Interaction.Triggers> </telerik:RadPanelBar>I am getting the topics correctly and I was not able to filter the second level elements since the selecteditem for RadPanelBar always return null values(I'm using MVVM model). Also I was not able to expand the radpanelbar items in design. Should i need to add code for that? i want to expand the selected element. please respond me asap.
Regards,
R.Saranya.