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

Sub Menu Items Generated from Database

5 Answers 84 Views
Menu
This is a migrated thread and some comments may be shown as answers.
grant
Top achievements
Rank 1
grant asked on 01 Jul 2008, 03:37 PM
Wondering how I can generate multi layerd sub menu items from data.  I have managed to get the first level sub menu to generate from the initial parent, but how can I generate children of the sub menu items?  I am using vb and this is the current code I have:

'Where To Stay

parentItem = radMenu.Items(1)

For Each row As DataRow In dt.Rows

childItem =

New RadMenuItem

childItem.Text = row(

"Name").ToString

childItem.NavigateUrl =

"~/AtlanticPortal/en/WhereToStay.aspx?Region=" & row("ID").ToString & "&Community=0&Category=0&ProvID=" & Session("ProvID").ToString & "&RegionName=" & row("Name").ToString

parentItem.Items.Add(childItem)

Next

I can get the sum benus to generate in relation to any of the 9 main menu items (parentItem = radMenu.Items(1)), but the sub menu items do not follow the same numbering...  I need the menu items to be generated from a data source as children of a child of menu item1 if that makes any sense.

5 Answers, 1 is accepted

Sort by
0
Dave Navarro
Top achievements
Rank 2
answered on 23 Jul 2008, 05:18 AM
Hello Grant,

I was wondering if you ever resolved this issue?

I've written code for this kind of scenario and thought I'd pass some along if you still need some help.

Let me know,

Dave
0
grant
Top achievements
Rank 1
answered on 23 Jul 2008, 11:07 AM
Thanks David, I have a work around that Im not happy with.  I basically made the first two levels of the menu static and generated the third level from data.

Id love to see your solution.
0
Dave Navarro
Top achievements
Rank 2
answered on 23 Jul 2008, 05:37 PM
Ok,

I've got a few things going on today but I'll put something together and post it here asap.

Talk to you again soon,

Dave
0
grant
Top achievements
Rank 1
answered on 16 Oct 2008, 12:56 PM
David, have you been able to come up with a solution here?
0
Dave Navarro
Top achievements
Rank 2
answered on 16 Oct 2008, 06:17 PM

Hello Grant,

Sorry for dropping off the map. I'd like to say that work can be unpredictable at times but it seems the reality is that it's unpredictable most of the time. But that's ok, sleep is over rated anyway.

I'm going to write up an explanation of my code and I'd like to send you some screen shots of the menu but we are not permitted to attach files. Would you please send me your email address and I'll send you some screen shots to go along with my explanation?

I'll put a reply here as well but I'll send you the screen shots.

Thanks!

Dave

Dave@OfficeAutomatedSystems.Com

Tags
Menu
Asked by
grant
Top achievements
Rank 1
Answers by
Dave Navarro
Top achievements
Rank 2
grant
Top achievements
Rank 1
Share this question
or