|
Rank: Member Groups: Member
Joined: 7/3/2007 Posts: 21
|
Hi,
I have creates a slidemenu, works great. The only thing I would like to do is to add an underline between each element - some sort of divider... Not underlining the font cause that makes the wrapped words appear as separate links
any idea how to do this?
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, There are two ways to do it. One way is to create a separator item. Another way is to modify NormalStyle/HoverStyle to include border-bottom attributes. You can find an example of the first method at here: http://www.essentialobjects.com/Demo/Default.aspx?path=Menu\_i0\_i2And an example of the second method at here: http://www.essentialobjects.com/Demo/Default.aspx?path=Menu\_i0\_i9Thanks
|
|
Rank: Member Groups: Member
Joined: 7/3/2007 Posts: 21
|
Hi thanks - I checked it out but it really doesn't help. I am trying to do it from the code behind page.
I tried adding menu.isSeparator = true; but then the whole menuItem disappears?
Goink???
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
A menu item is either separator or a regular menu item. It can not be both. When you see a separator, it's a separator, it is not a menu item with a separator.
Thanks
|
|
Rank: Member Groups: Member
Joined: 7/3/2007 Posts: 21
|
Ok - So I still don' understand how to create some sort of separator programmatically.
the two examples show how to do it in ASP but not in C sharp.
This is the code I have maybe that will help.
DataTable dt = CreateIndustrisDataTable(); EO.Web.MenuItem menu = new EO.Web.MenuItem("Ind"); menu.NormalStyle.BackColor = System.Drawing.Color.Silver; menu.NormalStyle.ForeColor = System.Drawing.Color.White; menu.SelectedStyle.BackColor = System.Drawing.Color.Blue; menu.SelectedStyle.ForeColor = System.Drawing.Color.White; menu.SubMenu.DataSource = dt; menu.SubMenu.Style.Font.Size = new FontUnit(7); menu.Expanded = true; menu.SubMenu.DataFields = "Name"; SlideMenu2.Items.Add(menu); EO.Web.DataBinding binding = new EO.Web.DataBinding(); binding.DataField = dt.Columns[0].ToString(); binding.Property = "NavigateUrl"; menu.SubMenu.Bindings.Add(binding); menu.SubMenu.DataBind();
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
In your case you probaby want to use the second method (give NormalStyle borders as shown in the demo). This way you can avoid using code behind. Generally you should avoid using creating separate items using code behind while using data binding. The reason is very simple, calling DataBind would wipe out all items that you previous created on that menu/sub menu. Getting around this is possible but I certainly would not recommend it in your case.
Just start your menu from "style 2" template with Menu Builder and then modify the colors in the look items. Once you get that looking right and then add your data binding code. That would be the easiest for you.
Thanks
|
|