Error when trying to access CommandBinding into a RadDropDownMenu

7 posts, 1 answers
  1. Frédéric
    Frédéric avatar
    11 posts
    Member since:
    Jul 2008

    Posted 11 Jul 2008 Link to this post

    Hello !

    Maybe this question as been already asked but I didn't find it.

    Into an item of a RadDropDownMenu, when I click the button on the right of CommandBinding, I have a message box that say :

    "Unable to cast object of type 'Telerik.WinControls.UI.RadSubMenuLayoutPanel' to type 'System.ComponentModel.IComponent'."

    Do you have an idea of what is going wrong. I m' currently testing your product with the demo version...

    Thanks in advance for your help.

    Best regards.

  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 14 Jul 2008 Link to this post

    Hello Frédéric,

    Thank you for writing.

    I did not manage to reproduce the described issue. To provide you with further assistance, please send me a more detailed description of the following:
    1. PC configuration
    2. Windows version
    3. Visual studio version
    4. Telerik controls version
    5. Step-by-step description of reproducing the exception
    I am looking forward to your reply.
     

    All the best,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Frédéric
    Frédéric avatar
    11 posts
    Member since:
    Jul 2008

    Posted 29 Jul 2008 Link to this post

    Hi,

    Here you will find the requested informations. Hope you will be able to help me.

    Best regards.


    System info :

    Système d'exploitation Microsoft Windows XP Professionnel 
    Version 5.1.2600 Service Pack 2 Nu 2600 
    Fabricant Dell Inc. 
    Modèle Precision WorkStation 670 
    Type X86-based PC 
    Processeur x86 Family 15 Model 4 Stepping 1 GenuineIntel ~2992 Mhz 


    Visual studio info :

     > Microsoft Visual Studio 2005
     > Version 8.0.50727.762  (SP.050727-7600)
     > Microsoft .NET Framework
     > Version 2.0.50727
     > Installed Edition: C# Express


    Telerik controls version

    Runtime Version : 2.0.50727
    Version : 6.1.0.0
    Trial version

    Step by step procedure :

     > Add a radDropDownMenu into your form
     > clic the little button right to "items" property
     > Add a new RadMenuItem
     > Clic the little button right to "CommandBinding" ... The error occurs !

  5. Frédéric
    Frédéric avatar
    11 posts
    Member since:
    Jul 2008

    Posted 29 Jul 2008 Link to this post

     
  6. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 01 Aug 2008 Link to this post

    Hello Frédéric,

    Thank you for the additional info.

    I have managed to reproduce the exception and I confirm that this is an issue in the old version Q1 2008 SP1. RadDropDownMenu component has replaced with RadContextMenu in new Q2 2008 release, and the described issue is not present anymore. I recommend you to upgrade to latest version and use RadContextMenu instead RadDropDownMenu.

    If you have other questions, do not hesitate to contact me again.

    Regards,
    Martin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Frédéric
    Frédéric avatar
    11 posts
    Member since:
    Jul 2008

    Posted 11 Aug 2008 Link to this post

    Hi,

    I did what you say but I have another problem.

    I set a ContextMenu for the radTreeview and a radContextMenu to a node.

    When I right click on the node, both menus appear on over each other…

    Is it normal?
  8. Answer
    Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 12 Aug 2008 Link to this post

    Hello Frédéric,

    In this case, you have to remove the ContextMenuStrip from RadTreeView when opening a context menu from the specified node. You could use ContextMenuShowing event to do this. Please, review the code-block below as example:
    private void Form1_Load(object sender, EventArgs e) 
        this.radTreeView1.Nodes[0].ContextMenu = this.radContextMenu1.DropDown; 
     
    private void radTreeView1_ContextMenuShowing(object sender, Telerik.WinControls.UI.ContextMenuShowingEventArgs e) 
        if (e.Node == this.radTreeView1.Nodes[0]) 
        { 
            this.radTreeView1.ContextMenuStrip = null
        } 
     
    private void radTreeView1_NodeMouseLeave(object sender, Telerik.WinControls.UI.RadTreeViewEventArgs e) 
        if (e.Node == this.radTreeView1.Nodes[0]) 
        { 
            this.radTreeView1.ContextMenuStrip = this.contextMenuStrip1; 
        } 

    I hope this helps. If you have other questions, do not hesitate to contact me again.

    Sincerely yours,
    Martin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready