MenuItem Alignment

2 posts, 0 answers
  1. Andy
    Andy avatar
    2 posts
    Member since:
    May 2011

    Posted 21 Jun 2011 Link to this post

    I have a RadMenu being populated from a database, and the menu items are variable based on user security.  I'd like each menu to have a "Home" item that is aligned to the left, and I'd like the remaining databound items to be aligned to the right.  Is there any way to accomplish this?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Jun 2011 Link to this post

    Hello Andy,

    You can attach OnItemDataBound and set the style from there.
    C#:
    protected void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e)
       {
           if (e.Item.Text == "root 1")
           {
               RadMenuItem item = (RadMenuItem)e.Item;
               item.CssClass = "test";
           }
       }

    Stylesheet:
    .test
        {  
         color:Red !important;
        }

    Thanks,
    Princy.
Back to Top