This is a migrated thread and some comments may be shown as answers.

Adding Combobox to Menu Item

5 Answers 162 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Jeremiah
Top achievements
Rank 1
Jeremiah asked on 05 May 2008, 03:08 AM
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.

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 05 May 2008, 03:01 PM
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
0
Jeremiah
Top achievements
Rank 1
answered on 08 May 2008, 05:07 PM
Awesome! Worked great. Thank you!
0
Bob Kolo
Top achievements
Rank 1
answered on 07 Jul 2008, 08:40 PM
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.
0
Peter
Telerik team
answered on 08 Jul 2008, 07:36 AM
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
0
Bill TenBroeck
Top achievements
Rank 1
answered on 23 Jan 2009, 08:59 PM
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.
Tags
Menu
Asked by
Jeremiah
Top achievements
Rank 1
Answers by
Peter
Telerik team
Jeremiah
Top achievements
Rank 1
Bob Kolo
Top achievements
Rank 1
Bill TenBroeck
Top achievements
Rank 1
Share this question
or