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

Unique template for parent vs child menu items for db bound menu

1 Answer 37 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 16 Jul 2008, 06:35 PM
I am trying to create a RadMenu that looks like this demo:

(http://www.telerik.com/DEMOS/ASPNET/Prometheus/Menu/Examples/Functionality/Templates/DefaultCS.aspx).

This demo creates the items statically.  I need for them to come from the database.

Just like in the demo link above, I want the top level parent to be a simply menu item, but I want the child menu items to all use a template like in the demo.

I tried creating an item template in the ascx and it worked great - except it was used for the top level (parent) items as well as the children - not what I want.

Any guidance or samples of this?  I searched the site but have come up rather empty.

Thanks!

Michael

1 Answer, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 17 Jul 2008, 03:02 AM
I solved the issue by ignoring the template concept altogether and simply adding controls dynamically to the item.Controls list on ItemDataBound event, but only when the item.Level is > 0.  This works just fine.

It would still be nice to know if there was a way to do this with templates.  If there is a way, please let us know!

Thanks!

Michael
Tags
Menu
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Share this question
or