Multiple menus causes error

2 posts, 1 answers
  1. Hannes Bantjes
    Hannes Bantjes avatar
    1 posts
    Member since:
    Jun 2003

    Posted 12 Nov 2008 Link to this post



    I have  the following setup:


    Control 1

    -----Control 1.1
    -----Control 1.2

    I start with the first control visible and then hides/shows control 1.1 or 1.2 based on a button click.  My problem is that I can hide/show any one of the sub-controls as many times as I want to and the menu on the sub control works 100%, but as soon as I show the second control hovering over the menu causes the following error:

    Microsoft JScript runtime error: Unhandled Error in Silverlight 2 Application: Value does not fall within the expected range.
       at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
       at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
       at MS.Internal.XcpImports.UIElement_UpdateLayout(UIElement element)
       at System.Windows.UIElement.UpdateLayout()
       at Telerik.Windows.Controls.PopupWrapper.AdjustPopupLocation()
       at Telerik.Windows.Controls.PopupWrapper.OnPopupOpened(Object sender, EventArgs e)
       at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

    Does anyone know what might be causing this error?  This only started happening after I upgared to the latest silverlight release.  Beta 2 worked fine.


  2. Answer
    Hristo avatar
    832 posts

    Posted 13 Nov 2008 Link to this post

    Hi Hannes,

    Hello Hannes,

    You are receiving an error because you have controls with same value on x:Name attribute. You are not allowed to have elements with same names (x:Name) in the same namescope. Remove the x:Name attribute or set different names and you application will work.

    If you have other questions, I'll be glad to help.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top