Hello,
I have a very simple piece of code to bind my RadMenu control to an ObservableList of Menus.
My xaml looks like this:
<telerik:RadMenu Name:"MainMenu" ItemsSource="{Binding Menus}"/>
This works fine. In order to display something more interesting, I can add:
<telerik:RadMenu Name:"MainMenu" ItemsSource="{Binding Menus}" DisplayMemberPath="Name" />
And I get the Name property of my Menus displayed.
Now I would like to get a step further as my Menu class has a SubMenus property so I try to play with RadMenuItem styling and this is where I get lost.
If I write simple code like this, that according to me should do the same as the DisplayMemberPath :
<telerik:RadMenu Name:"MainMenu" ItemsSource="{Binding Menus}" >
<telerik:RadMenu.Resources>
<Style TargetType="telerik:RadMenuItem">
<Setter Property="Header" Value="{Binding Name}"/>
</Style>
</telerik:RadMenu.Resources>
</telerik:RadMenu>
Nothing is displayed on my window when running the code.
I have checked everything, I can see in my view that the Menu is created and the items inside, etc... but the RadMenus don't display.
As soon as I comment out the Style, menus are displayed. As everything else is straightforward in my code, I think I am missing something obvious but I can't find it. There is no error in debug for binding issues or else.
I use Telerik 2017.1.22.45.
Thanks for your feedback.