Welcome Guest Search | Active Topics | Sign In | Register

Difficulty dynamically adding MenuItem Options
John W. Butler
Posted: Friday, October 30, 2009 6:53:58 PM
Rank: Newbie
Groups: Member

Joined: 10/30/2009
Posts: 2
I am using the dropdownlist with the toolbar control. I have created a context menu that is connected via the dropdownmenuid property. I am trying to dynamically add menu items in the code behind page_init event. The problem is when I try to set the menu item's text property it will not accept a string. Can you please provide an example of how to set the text property of the menuitem object in the code behind page. Thanks,

Code: Visual Basic.NET
Dim mi As EO.Web.MenuItem = Nothing
            For Each key As Integer In Item.Keys
                mi = New EO.Web.MenuItem()
                With mi
                    .ItemID = CStr(key)
                    .Text = CType(Item(key).Desc, EO.Web.NavigationItemText)  'doesn’t work
                    .Text = Item(key).Desc  'doesn’t work
                End With
                Me.Menu1.Items(0).SubMenu.Items.Add(mi)
            Next
eo_support
Posted: Saturday, October 31, 2009 10:54:51 AM
Rank: Administration
Groups: Administration

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

You will need to do .Text.Html = "something"

Thanks
John W. Butler
Posted: Tuesday, November 3, 2009 8:04:05 PM
Rank: Newbie
Groups: Member

Joined: 10/30/2009
Posts: 2
Angel Worked like a champ, thanks...
eo_support
Posted: Tuesday, November 3, 2009 8:35:36 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great. Glad that it worked for you!


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.