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

Right align a single RadMenuItem

2 Answers 478 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Bill O'Neil
Top achievements
Rank 1
Bill O'Neil asked on 23 Nov 2009, 10:16 PM
not sure if I'm missing something obvious here - but is there a way to right align a single menu item?
Basically I have a 100% width menu - where I want most of the menu items to appear normally (aligned to the left) but the last item (a logoff button) to always appear at the right side (end) of the menu.

Possible?

2 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 24 Nov 2009, 07:51 AM
Hi Bill,

Please find below a sample code snippet that shows the needed approach.

<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        div.RadMenu .rmLast
        {
            float: right;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1">
    </telerik:RadScriptManager>
    <telerik:RadMenu ID="RadMenu1" runat="server" Width="100%">
        <Items>
            <telerik:RadMenuItem runat="server" Text="Root RadMenuItem1">
                <Items>
                    <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 1">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 2">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 3">
                    </telerik:RadMenuItem>
                </Items>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem runat="server" Text="Root RadMenuItem2">
                <Items>
                    <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 1">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 2">
                    </telerik:RadMenuItem>
                </Items>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem runat="server" Text="Root RadMenuItem3">
            </telerik:RadMenuItem>
        </Items>
    </telerik:RadMenu>
    </form>
</body>
</html>


Greetings,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
barshj
Top achievements
Rank 1
answered on 04 Dec 2009, 06:26 PM
 
div.RadMenu .rmLast   
{  
float: right;   

 

 

 

does not work properly for menues with subitems in IE6/7 even though it does in IE8. The above style causes the last sub-menu item in the menu to be displaced floating right as well as the menu item you had intended.

Yana from the Telerik team gave me these styles to replace the above style which solves the problem. I thought this to be something useful for others who are trying to do this with their menu.
 

 

div.RadMenu .rmRootGroup .rmLast   
{  
float: right;   
}  
 
div.RadMenu .rmGroup .rmLast  
{  
float: none;   
}  
 

 

works for me. Thanx Yana!!!

 

Tags
Menu
Asked by
Bill O'Neil
Top achievements
Rank 1
Answers by
Paul
Telerik team
barshj
Top achievements
Rank 1
Share this question
or