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

2 posts, 0 answers
  1. Michael
    Michael avatar
    69 posts
    Member since:
    Jun 2008

    Posted 16 Jul 2008 Link to this post

    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
  2. Michael
    Michael avatar
    69 posts
    Member since:
    Jun 2008

    Posted 16 Jul 2008 Link to this post

    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
Back to Top