Context Menu Width

8 posts, 1 answers
  1. Lloyd McDonald
    Lloyd McDonald avatar
    3 posts
    Member since:
    Jun 2008

    Posted 04 Aug 2008 Link to this post

    Hello,

    I'm having difficulty getting a context menu to expand to the width of the current node's text.  The tree view's context menu in your examples solution always expands to the width of the menu item's text, but I could not find any references where the width of the context menu or its items is explicitly being set.

    I'm also using the same jscript function: setMenuItemsState to set the menu item's text.

    Please advise.
  2. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 05 Aug 2008 Link to this post

    Hello Lloyd,

    Could you, please, try to set the width of the first item of the context menu? If this doesn't help, please, send us sample code illustrating the problem,  so we can test it locally?

    Kind regards,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Lloyd McDonald
    Lloyd McDonald avatar
    3 posts
    Member since:
    Jun 2008

    Posted 11 Aug 2008 Link to this post

    Yana,

    That did the trick!

    Thanks.
  5. Carl-Johan
    Carl-Johan avatar
    22 posts
    Member since:
    May 2008

    Posted 12 Oct 2008 Link to this post

    I have the same problem, I use a web.sitemap. How do I do it.

    Thanks

    Carl-Johan Larsson
  6. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 13 Oct 2008 Link to this post

    Hello Carl-Johan,

    You can use the following style to set the width of the context menu:

    <style type="text/css">  
    .rmFirst {  
       width200px !important;  
    }  
    </style> 

    Kind regards,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Carl-Johan
    Carl-Johan avatar
    22 posts
    Member since:
    May 2008

    Posted 14 Oct 2008 Link to this post

    So simple, thanks.

    Carl-Johan Larsson
  8. abhay
    abhay avatar
    6 posts
    Member since:
    Oct 2006

    Posted 05 Jan 2012 Link to this post

    Hello,

    I'm facing the same problem... I have given a width to the first item in the context menu but I can see a gapping in the context menu on mouse hover. Can we set the width of the context menu depending on the tree node text width?

    Regards,
    Abhay
  9. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 09 Jan 2012 Link to this post

    Hi Abhay,

    The issue that you encounter is due to the width of the menu item. Since the text of the ManuItem is very long and the sprite image of the menu is not long enough (simply not designed for items containing long text) you get the gap that appears on the image. Therefore you can either shorten the item's text or alter the sprite image that is applied as a background to the RadContextMenu (as described in this help article).  

    Regards,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017