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

MenuItem Alignment

1 Answer 76 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 21 Jun 2011, 07:10 PM
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?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Jun 2011, 11:24 AM
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.
Tags
Menu
Asked by
Andy
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or