I am trying to bind a RadContextMenu to dynamic data. For now though I am simply creating three items in the initialization method.
When I run the code WITHOUT having set the ItemContainerStyle in the RadContextMenu, I get a ContextMenu, however the text being displayed is the class name of the item being bound (see attached file for example)
When I insert the ItemContainerStyle in the XAML, nothing is displayed. However, in the "Opened" event of the RadContextMenu, I do see that the menu is "trying" to open yet nothing is ever displayed.
Without ItemContainerStyle, I get a pop-up with the class name of the items.
With ItemContainerStyle, I get nothing.
Here is the code wireup:
XAML in the UserControl where the RadContextMenu is defined:
<telerik:RadContextMenu.ContextMenu> <telerik:RadContextMenu x:Name="WorkListContextMenu" ItemsSource="{Binding WorkListContextMenuItems}" Opened="WorkListContextMenu_Opened"> <telerik:RadContextMenu.ItemContainerStyle> <Style TargetType="telerik:RadMenuItem"> <Setter Property="Header" Value="{Binding Header}" /> <Setter Property="ItemsSource" Value="{Binding SubItems}" /> <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/> <Setter Property="IsChecked" Value="{Binding IsChecked}"/> </Style> </telerik:RadContextMenu.ItemContainerStyle> </telerik:RadContextMenu></telerik:RadContextMenu.ContextMenu>
When I comment out the "telerik:RadContextMenu.ItemContainerStyle" section, the pop-up appears, but with the classname of the ItemsSource Binding objects.
Not sure what I can do, I've researched for two days now and cannot find the solution. Can someone please offer a suggestion as to what I'm doing wrong?