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

RadMenu not responding

2 Answers 45 Views
Menu
This is a migrated thread and some comments may be shown as answers.
bohebolo
Top achievements
Rank 1
bohebolo asked on 10 Aug 2010, 04:08 PM
I don't know if this a bug or not, but here is how to reproduce the behavior.

The xaml:
<UserControl x:Class="TestTelerik.MainPage"
    xmlns:compMod="clr-namespace:System.ComponentModel;assembly=System.Windows"
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls assembly=Telerik.Windows.Controls.Navigation"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
 
    <UserControl.Resources>
        <!-- mainMenu template -->
        <telerik:HierarchicalDataTemplate x:Key="mainMenuTemplate" ItemsSource="{Binding SubItems}">
            <telerik:ContainerBinding.ContainerBindings>
                <telerik:ContainerBindingCollection>
                    <telerik:ContainerBinding PropertyName="Icon" Binding="{Binding Icon}" />
                </telerik:ContainerBindingCollection>
            </telerik:ContainerBinding.ContainerBindings>
            <TextBlock Text="{Binding Text}" />
        </telerik:HierarchicalDataTemplate>
 
        <!-- mainMenu collectionViewSource -->
        <CollectionViewSource x:Name="mainMenuItemsSource">
            <CollectionViewSource.SortDescriptions>
                <compMod:SortDescription PropertyName="MenuID" Direction="Ascending"/>
            </CollectionViewSource.SortDescriptions>
        </CollectionViewSource>
    </UserControl.Resources>
 
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
 
        <telerikNavigation:RadMenu x:Name="mainMenu" ClickToOpen="False" ItemTemplate="{StaticResource mainMenuTemplate}" VerticalAlignment="Top" Width="Auto" Grid.Column="0" Grid.Row="0" />
    </Grid>
</UserControl>

code behind:
public class MenuItem
{
    public MenuItem()
    {
        this.SubItems = new ObservableCollection<MenuItem>();
    }
 
    public int MenuID
    {
        get;
        set;
    }
 
    public string Text
    {
        get;
        set;
    }
 
    public Image Icon
    {
        get
        {
            return _icon;
        }
    }
    private Image _icon;
 
    public ObservableCollection<MenuItem> SubItems
    {
        get;
        set;
    }
}
 
public partial class MainPage : UserControl
{
    public MainPage()
    {
        StyleManager.ApplicationTheme = new Windows7Theme();
        InitializeComponent();
        LayoutRoot.Loaded +=new RoutedEventHandler(LayoutRoot_Loaded);
    }
 
    private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
    {
        ObservableCollection<MenuItem> col;
 
        MenuItem manageFormsMenu = new MenuItem()
        {
            MenuID = 100801,
            Text = "Manage Forms"
        };
 
        MenuItem getDataMenu = new MenuItem()
        {
            MenuID = 100803,
            Text = "Get Data"
        };
 
        col = new ObservableCollection<MenuItem>();
        col.Add(manageFormsMenu);
        col.Add(getDataMenu);
 
        MenuItem maintenanceMenu = new MenuItem()
        {
            MenuID = 100800,
            Text = "Maintenance",
            SubItems = col
        };
 
        MenuItem logoutMenu = new MenuItem()
        {
            MenuID = 100900,
            Text = "Logout"
        };
 
        col = new ObservableCollection<MenuItem>();
        col.Add(maintenanceMenu);
        col.Add(logoutMenu);
 
        MenuItem systemMenu = new MenuItem()
        {
            MenuID = 100000,
            Text = "System",
            SubItems = col
        };
 
        MenuItem stockInMenu = new MenuItem()
        {
            MenuID = 110101,
            Text = "Stock In"
        };
 
        col = new ObservableCollection<MenuItem>();
        col.Add(stockInMenu);
 
        MenuItem unitMenu = new MenuItem()
        {
            MenuID = 110000,
            Text = "Unit",
            SubItems = col
        };
 
        col = new ObservableCollection<MenuItem>();
        col.Add(systemMenu);
        col.Add(unitMenu);
 
        mainMenuItemsSource.Source = col;
        mainMenu.ItemsSource = mainMenuItemsSource.View;
    }
}

Now run it, click system - logout menu. Then hover on system - maintenance menu, and move the cursor to Unit menu.

FYI, i'm using 2010 Q1 SP1..

2 Answers, 1 is accepted

Sort by
0
Accepted
Pana
Telerik team
answered on 13 Aug 2010, 07:59 AM
Hello Bohe,

I have tested your project with the latest DLLs and there are no problems. Would you consider upgrading to newer release version?

Regards,
Panayot
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
0
bohebolo
Top achievements
Rank 1
answered on 13 Aug 2010, 08:37 AM
Installed Q1 2010 SP2, and yes it's working now.
Tags
Menu
Asked by
bohebolo
Top achievements
Rank 1
Answers by
Pana
Telerik team
bohebolo
Top achievements
Rank 1
Share this question
or