This question is locked. New answers and comments are not allowed.
Hi telerik,
I am working on my first Breadcrumb. It binds (on Level 1) to a flat ObservableCollection, on the following levels on a hierarchical/self-referencing entity set. I am therefore trying to use the ItemTemplateSelector property but it seems the TemplateSelector's SelectTemplate() method never gets called.
1. I got the same thing working OK with a RadTreeView.
2. If I define a HierarchicalDataTemplate within the breadcrumb directly, the binding works but only for Level 1 and 2, i.e. the self-referencing part is missing - unsurprisingly, as the template is designed for level 1/2 only.
Would you have any example how to use TemplateSelector with RadBreadCrumb?
Your help most appreciated, thx,
bluewater
My breadcrumb:
My Selector XAML:
My template selector is basically right from your league/division/team example, with the required mods
I am working on my first Breadcrumb. It binds (on Level 1) to a flat ObservableCollection, on the following levels on a hierarchical/self-referencing entity set. I am therefore trying to use the ItemTemplateSelector property but it seems the TemplateSelector's SelectTemplate() method never gets called.
1. I got the same thing working OK with a RadTreeView.
2. If I define a HierarchicalDataTemplate within the breadcrumb directly, the binding works but only for Level 1 and 2, i.e. the self-referencing part is missing - unsurprisingly, as the template is designed for level 1/2 only.
Would you have any example how to use TemplateSelector with RadBreadCrumb?
Your help most appreciated, thx,
bluewater
My breadcrumb:
<
telerik:RadBreadcrumb
Name
=
"Breadcrumb"
Grid.Column
=
"1"
Grid.Row
=
"3"
ItemsSource
=
"{Binding Serviceclasses}"
ItemTemplateSelector
=
"{StaticResource myDataTemplateSelector}"
>
My Selector XAML:
<
UserControl.Resources
>
<
telerik:HierarchicalDataTemplate
x:Key
=
"ChildServicegroupsTemplate"
ItemsSource
=
"{Binding Path=ChildServicegroups}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Sortkey}"
Margin
=
"0,0,10,0"
/>
<
TextBlock
Text
=
"{Binding Code}"
FontWeight
=
"Bold"
/>
<
TextBlock
Text
=
"{Binding Name}"
Margin
=
"10,0,0,0"
/>
</
StackPanel
>
</
telerik:HierarchicalDataTemplate
>
<
telerik:HierarchicalDataTemplate
x:Key
=
"ServicegroupsTemplate"
ItemsSource
=
"{Binding Path=ChildServicegroups}"
ItemTemplate
=
"{StaticResource ChildServicegroupsTemplate}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Sortkey}"
Margin
=
"0,0,10,0"
/>
<
TextBlock
Text
=
"{Binding Code}"
FontWeight
=
"Bold"
Foreground
=
"Blue"
FontSize
=
"12"
/>
<
TextBlock
Text
=
"{Binding Name}"
Margin
=
"10,0,0,0"
Foreground
=
"Blue"
FontSize
=
"12"
/>
</
StackPanel
>
</
telerik:HierarchicalDataTemplate
>
<
telerik:HierarchicalDataTemplate
x:Key
=
"ServiceclassTemplate"
ItemTemplate
=
"{StaticResource ServicegroupsTemplate}"
ItemsSource
=
"{Binding Servicegroups}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Name}"
Foreground
=
"Green"
FontSize
=
"24"
/>
</
StackPanel
>
</
telerik:HierarchicalDataTemplate
>
<
itsf:ServicegroupsTemplateSelector
x:Key
=
"myDataTemplateSelector"
ServiceclassTemplate
=
"{StaticResource ServiceclassTemplate}"
ServicegroopRootTemplate
=
"{StaticResource ServicegroupsTemplate}"
ServicegroupChildTemplate
=
"{StaticResource ChildServicegroupsTemplate}"
/>
</
UserControl.Resources
>
My template selector is basically right from your league/division/team example, with the required mods