Adding Combobox to Menu Item

6 posts, 0 answers
  1. Jeremiah
    Jeremiah avatar
    5 posts
    Member since:
    May 2008

    Posted 04 May 2008 Link to this post

    I have a normal, horizontal-looking menu with about 5 different main menu items -- I'd like to add a Combobox as the content for another menu item, and have this particular menu item aligned to the right of the whole menu. So, regardless of the width of the menu, the combobox menu item would always be on the far right. I've attempted to do this with little luck -- also, when adding a combobox, or any custom template to a menu item, the background is just white. I'm using the Black skin and would like to keep the background the same as all of the other menu items with just plain text... thank you for any help.
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 05 May 2008 Link to this post

    Hi Jeremiah,

    Please, try the following example:

    <head runat="server">  
        <title>Untitled Page</title> 
        <style type="text/css">  
        .ComboBoxItem  
        {  
            float: right !important;  
        }  
        .rmItem .rmText  
        {  
            margin-top: -2px;  
        }  
        </style> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
            <asp:ScriptManager ID="ScriptManager1" runat="server">  
            </asp:ScriptManager> 
            <telerik:RadMenu ID="RadMenu1" Width="100%" Height="25px" Skin="Black" runat="server">  
                <CollapseAnimation Duration="200" Type="OutQuint" /> 
                <Items> 
                    <telerik:RadMenuItem runat="server" Text="Root RadMenuItem1">  
                    </telerik:RadMenuItem> 
                    <telerik:RadMenuItem runat="server" Text="Root RadMenuItem2">  
                    </telerik:RadMenuItem> 
                    <telerik:RadMenuItem runat="server" Text="Root RadMenuItem3">  
                    </telerik:RadMenuItem> 
                    <telerik:RadMenuItem runat="server" Text="Root RadMenuItem4">  
                    </telerik:RadMenuItem> 
                    <telerik:RadMenuItem runat="server" CssClass="ComboBoxItem" Text="Root RadMenuItem5">  
                        <ItemTemplate> 
                            <telerik:RadComboBox Skin="Black" ID="RadComboBox1" runat="server">  
                                <Items> 
                                    <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" /> 
                                    <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" /> 
                                    <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3" /> 
                                </Items> 
                                <CollapseAnimation Duration="200" Type="OutQuint" /> 
                            </telerik:RadComboBox> 
                        </ItemTemplate> 
                    </telerik:RadMenuItem> 
                </Items> 
            </telerik:RadMenu> 
        </form> 
    </body> 

    Feel free to contact us if you have any further questions or concerns.



    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Jeremiah
    Jeremiah avatar
    5 posts
    Member since:
    May 2008

    Posted 08 May 2008 Link to this post

    Awesome! Worked great. Thank you!
  4. Bob Kolo
    Bob Kolo avatar
    1 posts
    Member since:
    Jun 2007

    Posted 07 Jul 2008 Link to this post

    As of the latest service pack, the style above does not work on a page that I am programmatically setting a particular menu item to be highlighted.

    Essentially, if I'm on a page showing the menu but nothing is set to be highlighted automatically, the combobox remains positioned properly, however when I do the HighlightPath method on a menu item on Page_Load, the combobox moves back to the spot as if I had never applied that style code before.

    Any help is appreciated. Thank you.
  5. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 08 Jul 2008 Link to this post

    Hi Bob,

    Thank you for your question.

    To fix the problem, please use the following css selectors:

    <style type="text/css">     
          
        .rmItem .rmText     
        {     
            margin-top: -2px !important;     
        }     
        .rmRootGroup .rmItem.rmLast  
        {  
                floatright;  
        }  
         
        </style>   


    Kind regards,
    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Bill TenBroeck
    Bill TenBroeck avatar
    5 posts
    Member since:
    Jul 2004

    Posted 23 Jan 2009 Link to this post

    Can this also be accomplished via an XML file declaration? I need to add a combo box as an item in a "Navigation" menu Group.
Back to Top