I need a dynamically bound splitbutton which can nest 2 levels deep. Is this possible, maybe with a HierarchicalDataTemplate? Currently, we use the RadMenu control for a split button but it's hard coded in the manner shown in the sample below, however, I need it to bind to a collection of items which contain a collection of subitems. The button would look like this:
MenuButton
Category1
SubCategory1
SubCategory2
Category2
SubCategoryA
The resulting click would then notify which SubItem I had clicked:
This is the hardcoded example:
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left">
<Telerik:RadMenu Grid.Row="0" x:Name="AnalysisTypeMenu" HorizontalAlignment="Left" HorizontalContentAlignment="Left" ClickToOpen="True" Style="{StaticResource OurButtonMenuStyle}">
<Telerik:RadMenuItem Name="ButtonName" Header="ButtonCaption" Style="{StaticResource OurMenuItemStyle}">
<Telerik:RadMenuItem Header="MenuItem1" >
<Telerik:RadMenuItem Header="FirstItemUnder1" Commands:ClickCommands.Command="{Binding AddNewCommand}" Commands:ClickCommands.CommandParameter="A1,A2"/>
<Telerik:RadMenuItem Header="SecondItemUnder1" Commands:ClickCommands.Command="{Binding AddNewCommand}" Commands:ClickCommands.CommandParameter="A1,A2" />
MenuButton
Category1
SubCategory1
SubCategory2
Category2
SubCategoryA
The resulting click would then notify which SubItem I had clicked:
This is the hardcoded example:
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left">
<Telerik:RadMenu Grid.Row="0" x:Name="AnalysisTypeMenu" HorizontalAlignment="Left" HorizontalContentAlignment="Left" ClickToOpen="True" Style="{StaticResource OurButtonMenuStyle}">
<Telerik:RadMenuItem Name="ButtonName" Header="ButtonCaption" Style="{StaticResource OurMenuItemStyle}">
<Telerik:RadMenuItem Header="MenuItem1" >
<Telerik:RadMenuItem Header="FirstItemUnder1" Commands:ClickCommands.Command="{Binding AddNewCommand}" Commands:ClickCommands.CommandParameter="A1,A2"/>
<Telerik:RadMenuItem Header="SecondItemUnder1" Commands:ClickCommands.Command="{Binding AddNewCommand}" Commands:ClickCommands.CommandParameter="A1,A2" />