Welcome Guest Search | Active Topics | Sign In | Register

Menu Populate from data table Options
Mehul Panchal
Posted: Sunday, July 11, 2010 8:03:45 AM
Rank: Member
Groups: Member

Joined: 7/7/2010
Posts: 28
Hi,

I am populating the Menu with data table as per below

table.Columns.Add("Country", GetType(String))
table.Columns.Add("State", GetType(String))
table.Columns.Add("WebSite", GetType(String))
table.Columns.Add("TWindow", GetType(String))
table.Rows.Add(New Object() {"Test", "", "http://yahoo.com", "_blank"})
table.Rows.Add(New Object() {"Test1", "Test2", "http://msn.com", "_blank"})

Menu1.DataSource = mainTable
Menu1.DataFields = "Country|State"
Dim binding As New EO.Web.DataBinding()
binding.DataField = "WebSite"
binding.Property = "NavigateUrl"
Menu1.Bindings.Add(binding)
binding = New EO.Web.DataBinding()
binding.DataField = "TWindow"
binding.Property = "TargetWindow"
Menu1.Bindings.Add(binding)
Menu1.DataBind()

Menu display as

Test->''
Test1->'Test2'

How to remove the blank sub items.

I want to create the menu dynamically from sql table.
eo_support
Posted: Monday, July 12, 2010 9:28:47 AM
Rank: Administration
Groups: Administration

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

You need to change your "" to null when you add the data row.

Thanks!
Mehul Panchal
Posted: Tuesday, July 13, 2010 5:04:19 AM
Rank: Member
Groups: Member

Joined: 7/7/2010
Posts: 28
Hi,

Thanks i have applied same and it is working ok.

Mehul


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.