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

NullReferenceException when open RadMenuItem

2 Answers 63 Views
Menu
This is a migrated thread and some comments may be shown as answers.
M3030
Top achievements
Rank 1
M3030 asked on 25 Apr 2013, 09:54 AM
I have a RadMenu made by this example. I sometimes get an error from the menu, but I dont know what causes it.

Stack trace:
vid Telerik.Windows.Controls.RadMenuItem.OpenMenu()     vid Telerik.Windows.Controls.RadMenuItem.OnOpenTimerTick(Object sender, EventArgs e)     vid MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)     vid MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

I´m getting the same error as from this post: http://www.telerik.com/community/forums/silverlight/menu/radcontextmenu-crashes.aspx
But theres no solution.

The menu I uses is bounded to a MenuViewModel that inherits from ObservableCollection<MenuViewModel> (like the example link I posted previously). The menu is build up with a lot of diffrent styles to handle the diffrent properties in the menu items. 

<navigation:Page.Resources>       
        <Styles:MenuItemStyleSelector
            x:Key="MenuItemStyleSelector"
            TopLevel="{StaticResource MenuItemTopLevelStyle}" 
            Title="{StaticResource MenuItemTitleStyle}"
            Link="{StaticResource MenuItemLinkStyle}"                                     
            ParagraphImage="{StaticResource ParagraphImageMenuItemStyle}"
            TopLevelSection="{StaticResource MenuItemTopLevelSectionStyle}"/>
 
        <telerik:HierarchicalDataTemplate x:Key="MenuItemTemplate" ItemsSource="{Binding }">
             
            <telerik:ContainerBinding.ContainerBindings>
                <telerik:ContainerBindingCollection>
                    <telerik:ContainerBinding PropertyName="Header" Binding="{Binding Content}" />
                    <telerik:ContainerBinding PropertyName="IsSeparator" Binding="{Binding IsSeparator}" />
                </telerik:ContainerBindingCollection>
            </telerik:ContainerBinding.ContainerBindings>
 
            <HyperlinkButton Content="{Binding Path=Content}" NavigateUri="{Binding Path=Url}" />
        </telerik:HierarchicalDataTemplate>
    </navigation:Page.Resources>
     
    <StackPanel>
        <telerik:RadMenu
            Style="{StaticResource MenuStyle}"
            ItemsSource="{Binding MenuItems}"
            ItemTemplate="{StaticResource MenuItemTemplate}"
            ItemContainerStyleSelector="{StaticResource MenuItemStyleSelector}" />       
    </StackPanel>



Does anyone know the soulution of the problem or what could be causing this issue?

I´m using telerik RadControls for Silverligt v 12.1.326.0, Silverlight 5 and C#.

Thx!

2 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 25 Apr 2013, 10:29 AM
Hi,

The error which from the other forum (http://www.telerik.com/community/forums/silverlight/menu/radcontextmenu-crashes.aspx) was fixed in our latest releases, so you shouldn't face it if you upgrade to our newest version. But maybe you are facing another problem that we have with the example in our demos. To fix it you should remove the popups from MenuItemTopLevelSectionControlTemplate and MenuItemGalleryControlTemplate.
Could you try upgrading to our newest version and check if the error still exists? Also you may try the solution with removing the mentioned popups.

Hopefully this helps. Feel free to contact us if you have any problems or concerns.

Regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Anmol
Top achievements
Rank 1
answered on 06 May 2016, 09:23 AM

Hi all,

I am also facing the same issue. Please suggest how to resolve this.

 

Thanks in advance

Tags
Menu
Asked by
M3030
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Anmol
Top achievements
Rank 1
Share this question
or