This is a migrated thread and some comments may be shown as answers.

RadContextMenu in RadDropDownButton

1 Answer 110 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 30 Jul 2010, 07:27 PM

This isn't working.  I cna't get the menu to expand in the dropdown

 
 

<UserControl  

x:Class="OVSNavigator.NavigatorReports"
xmlns:local="clr-namespace:OVSNavigator"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tel="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
xmlns:telerikNav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">

<UserControl.Resources>
<CollectionViewSource x:Key="reportsViewModelViewSource"
        d:DesignSource="{d:DesignInstance local:ReportViewModel, CreateList=True}" />
 
< CollectionViewSource x:Key="reportTypeViewModelViewSource"
        d:DesignSource="{d:DesignInstance local:ReportTypeListViewModel, CreateList=True}" />
</UserControl.Resources>

<Grid x:Name="LayoutRoot" Background="White" DataContext="{StaticResource reportsViewModelViewSource}" >
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" Background="LightGray">
<tel:RadToolBar x:Name="_toolsToolbar" Grid.Row="1" >
    <telerik:RadDropDownButton Tag="Open Exisiting Report" DataContext="{StaticResource reportTypeViewModelViewSource}">
    <Image Source="../images/report.png" ToolTipService.ToolTip="Open Existing Report" ToolTipService.Placement="Top" Width="16" Height="16" />
        <telerik:RadDropDownButton.DropDownContent>
            <StackPanel Height="300" >
                <telerikNav:RadContextMenu BorderThickness="1.5" ItemsSource="{Binding Model}" >
                    <telerikNav:RadContextMenu.ItemTemplate>
                        <telerik:HierarchicalDataTemplate ItemsSource="{Binding Path=Children}">
                            <TextBlock Text="{Binding Path=Name}" Foreground="Black" ToolTipService.ToolTip="{Binding Path=Name}" />
                        </telerik:HierarchicalDataTemplate>
                    </telerikNav:RadContextMenu.ItemTemplate>
                </telerikNav:RadContextMenu>
            </StackPanel>
        </telerik:RadDropDownButton.DropDownContent>
    </telerik:RadDropDownButton>
</tel:RadToolBar>
 
</StackPanel>

<telerik:RadHtmlPlaceholder Grid.Row="1" x:Name="_htmlReport" SourceUrl="{Binding Path=SourceUri, Mode=TwoWay}" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible" />
</Grid>
 

The menu does not appear when I try to expand it.  I nkow the data is there.  Can someone tell me what I am doing wrong?  I think it's not expanding correctly.
The menu list will only be 2 deep.  They are ObservableCollection<ReportType>
 
This is a ReportType:
 
public partial class ReportType : INotifyPropertyChanged {

#region Business
public NodeType NodeType { get; set; }
private string _name = String.Empty;
public string Name {
get { return _name; }
set { _name = value; OnPropertyChanged("Name"); }
}

 
private string _category = String.Empty;
public string Category {
get { return _category; }
set { _category = value; OnPropertyChanged ("Category"); }
}

#endregion

 
 

 

private ObservableCollection<ReportType> _children;
public ObservableCollection<ReportType> Children {
get { return _children; }
set { _children = value; OnPropertyChanged ("Children"); }
}
#region INotifyPropertyChanged Members

public event PropertyChangedEventHandler PropertyChanged;

protected virtual void OnPropertyChanged(string propertyName) {
if (PropertyChanged != null) {
PropertyChanged (this, new PropertyChangedEventArgs (propertyName));
}
}
#endregion

}

ed

 

 

 

1 Answer, 1 is accepted

Sort by
0
Vladislav
Telerik team
answered on 04 Aug 2010, 01:02 PM
Hi Edward,

Can you please check my answer in your support thread.

All the best,
Vladislav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Menu
Asked by
Edward
Top achievements
Rank 1
Answers by
Vladislav
Telerik team
Share this question
or