Welcome Guest Search | Active Topics | Sign In | Register

How to add a separator via code Options
Bazooka
Posted: Tuesday, September 29, 2009 5:30:13 PM
Rank: Advanced Member
Groups: Member

Joined: 7/3/2009
Posts: 37
I'm trying to add a separator between Item1 and Item2 and it won't display, I get no errors.

Also I'm adding a subitem1 under Item1, is there a way to use the name identifier instead of a [0]. mnuPlans.Items[0].SubItems.Add("SubItem1"); can't you do this: mnuPlans.Items['Item1'].SubItems.Add("SubItem1")?

EO.Web.MenuItem MnuItemPlans = mnuHealthPlans.Items.Add("Item1");
EO.Web.MenuItem Separator = new EO.Web.MenuItem();
Separator.IsSeparator = true;
Separator.ItemID = "_Separator";
mnuPlans.Items.Add("Item2");

//Add a Url for the MenuItem.
MnuItemPlans.NavigateUrl = "~/scripts/default.asp";
mnuPlans.Items[0].SubItems.Add("SubItem1");
eo_support
Posted: Wednesday, September 30, 2009 8:33:51 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You can not use name identifier instead of item index because the names may not be unique.

Your code to create the separator is wrong. You created the separator in memory, but you did not add it to the menu.

Thanks
Bazooka
Posted: Wednesday, September 30, 2009 12:12:57 PM
Rank: Advanced Member
Groups: Member

Joined: 7/3/2009
Posts: 37
Can you please show me the correct way to add a separator between the two items via code?
eo_support
Posted: Wednesday, September 30, 2009 12:15:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Please see your private message for our replies.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.