Problem using RadMenu

7 posts, 1 answers
  1. Alan
    Alan avatar
    29 posts
    Member since:
    Feb 2008

    Posted 21 Jan 2011 Link to this post

    I have just updated to the latest version of the trial controls and now get the error below after dragging a RadMenu control onto a user control.

    Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)

    When I dragged the RadMenu to the design surface, the following reference was added:

    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 

    This is what I would have expected.  Please help.
  2. Alan
    Alan avatar
    29 posts
    Member since:
    Feb 2008

    Posted 21 Jan 2011 Link to this post

    This problem went away by itself. I did nothing to make it disappear.
  3. DevCraft banner
  4. Alan
    Alan avatar
    29 posts
    Member since:
    Feb 2008

    Posted 21 Jan 2011 Link to this post

    I only thought it went away. The RadMenu seemed to work but I couldn't get expression blend to load the user control where the menu is used,  I then tried a test to drag a menu into a new user control and it again and had the same problem.  It produced a more detailed error message in VS 2010:

    Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

    at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
    at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
    at MS.Internal.XcpImports.Collection_Add[T](PresentationFrameworkCollection`1 collection, Object value)
    at System.Windows.PresentationFrameworkCollection`1.AddImpl(Object value)
    at System.Windows.PresentationFrameworkCollection`1.System.Collections.IList.Add(Object value)
    at Microsoft.Expression.DesignModel.InstanceBuilders.ClrObjectInstanceBuilder.InstantiateChildren(IInstanceBuilderContext context, ViewNode viewNode, DocumentCompositeNode compositeNode, Boolean isNewInstance)

    I want to style the menu in expression blend so I need for it to be able to load there as well as not cause an error in VS 2010.

  5. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 24 Jan 2011 Link to this post

    Hi Alan,

    I'm unable to reproduce this issue. I've created new Blend 4 (version 4.0.20901.0) project, added reference to Telerik.Windows.Controls and Telerik.Windows.Controls.Navigation assemblies and then dragged a RadMenu into design surface. It was added with few children (RadMenuItems) and renders correctly. The same project design time works in Visual Studio 2010 Ultimate too.

    Please let us know the exact steps to reproduce this error. Also please check that you are using the same version of assemblies (both should be 2010.3.1314.1040) and if possible try to create a new project and let us know if the problem exist (Blend is caching the assemblies so when you upgrade to newer version blend is mixing the old with the new assemblies and produce such strange errors).

    Best wishes,
    Hristo
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. Alan
    Alan avatar
    29 posts
    Member since:
    Feb 2008

    Posted 24 Jan 2011 Link to this post

    Thanks for the reply.  After much searching on the web, I concluded that I had some corrupted project files.  Using devenv /rebuild, I was able to repair my application after which, the problem with RadMenu went away.

    I do have another question though.  In Blend or VS 2010, when I dragged a RadMenu onto the Artboard, the following reference was created:


    Is it preferred to use that reference rather than:
     
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
     

     

     

     

     

  7. Answer
    Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 25 Jan 2011 Link to this post

    Hi Alan,

    The first one "telerik" is a URI namespace which allows you to have multiple CLR namespaces mapped to it. For example if you add Controls and Input assemblies using the URI namespace you will be able to see all controls from both assemblies.

    The other "telerikNavigation" is not a URI namespace, its pointing directly to a CLR namespace so you will be able to see only controls from this namespace in the specified assembly.

    I would recommend using the URI namespace because it is more convenient and you will need much less defined namespaces in XAML which will lead to cleaner xaml.

    All the best,
    Hristo
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  8. Alan
    Alan avatar
    29 posts
    Member since:
    Feb 2008

    Posted 25 Jan 2011 Link to this post

    Thanks.  That is what I was thinking, that it would be simpler and cleaner.
Back to Top
DevCraft banner