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

[Solved] Menu Item Alignment

0 Answers 58 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael
Top achievements
Rank 1
Michael asked on 25 Feb 2011, 11:31 PM
Hello Telerik Community,

Can any of you tell me if there is a way to align menu items?  I would like the last menu item I add align to the right of the menu bar.  Here is the code I'm using.

Thanks!!!

<%=                 
        Html.Telerik().Menu()
            .Name("Menu")
            .BindTo(Html.MvcSiteMap().Provider.RootNode.ChildNodes, mappings => 
                mappings.For<MvcSiteMapProvider.MvcSiteMapNode>(binding => binding
                .ItemDataBound((item, node) =>
                    {
                        item.Text = node.Title;
                        item.ActionName = node.Action;
                        item.ControllerName = node.Controller;
                        if (!string.IsNullOrEmpty(node.ImageUrl))
                            item.ImageUrl = node.ImageUrl;
                    })
                    .Children(node => node.ChildNodes)))
            .HighlightPath(true).Items(menu =>
                {
                    if (!string.IsNullOrEmpty(Page.User.Identity.Name))
                    {
                        menu.Add()
                            .Text(string.IsNullOrEmpty(Page.User.Identity.Name) ? "Account" : Page.User.Identity.Name)
                            .Items(Item =>
                                {
                                    Item.Add().Text("My Account").Url("~/Account/MySettings");
                                    Item.Add().Text("Log Off").Url("~/Account/LogOff");
                                });
                    }
                })
              
%>
Tags
Menu
Asked by
Michael
Top achievements
Rank 1
Share this question
or