Hi,
I have a very simple scenario in which I try to use the RadPanelBar, the goal is something like this:
Now the actual list of Groups is not static so I need to databind, and this is where the problems begin.
It seems there is no way of declaring the content of each RadPanelBarItem so that it will use the same datacontext as the item itself.
The only way to solve this that I have come up with so far is to let the ViewModel implement IEnumerable and simply return itself. Doing that will make the following work.
This just seems like a rather cumbersome and unintuitive way to solve a very simple scenario. I would have expected something like a HeaderTemplate and a BodyTemplate instead.
Am I missing something?
Brgds,
Thomas Scheelhardt
I have a very simple scenario in which I try to use the RadPanelBar, the goal is something like this:
<
telerik:RadPanelBar
>
<
telerik:RadPanelBarItem
Header
=
"Group1"
>
<
local:GroupList
/>
</
telerik:RadPanelBarItem
>
<
telerik:RadPanelBarItem
Header
=
"Group2"
>
<
local:GroupList
/>
</
telerik:RadPanelBarItem
>
</
telerik:RadPanelBar
>
It seems there is no way of declaring the content of each RadPanelBarItem so that it will use the same datacontext as the item itself.
The only way to solve this that I have come up with so far is to let the ViewModel implement IEnumerable and simply return itself. Doing that will make the following work.
<
telerik:RadPanelBar
ItemsSource
=
"{Binding Groups}"
>
<
telerik:RadPanelBar.ItemTemplate
>
<
telerik:HierarchicalDataTemplate
ItemsSource
=
"{Binding}"
>
<
TextBlock
Text
=
"{Binding Title}"
Margin
=
"5,3"
/>
<
telerik:HierarchicalDataTemplate.ItemTemplate
>
<
DataTemplate
>
<
local:GroupList
/>
</
DataTemplate
>
</
telerik:HierarchicalDataTemplate.ItemTemplate
>
</
telerik:HierarchicalDataTemplate
>
</
telerik:RadPanelBar.ItemTemplate
>
</telerik:RadPanelBar
This just seems like a rather cumbersome and unintuitive way to solve a very simple scenario. I would have expected something like a HeaderTemplate and a BodyTemplate instead.
Am I missing something?
Brgds,
Thomas Scheelhardt