Can I create a complex menu

4 posts, 1 answers
  1. Paul
    Paul avatar
    55 posts
    Member since:
    Nov 2010

    Posted 20 May 2012 Link to this post

    Hi. I have a specific menu requirement. I know that individual parts can be created with the radMenu but I don't know how to create it as a whole (or whether it can be created).

    The menu has a complex structure but each part is fairly simple. My main problem is the third level of the menu (I've already created the first two levels).

    So the first level is fairly straightforward and can be defined in the aspx.cs file (ie its fixed). Each level 1 menu item is unique but its relatively straightforward. The second level for menu.items[0] is also straightforward but has to be created in code, cannot be predefined in the aspx.cs but can be created using fairly straightfoward radMenuItems (which can then be added to menu.items[0].items

    My problem is that each of these second level menu items (but only in menu.items[0].items) would ideally be defined with an itemtemplate. Each item in menu.items[0].items will have a sub menu with the same template but different data and each is effectively a mega dropdown. I understand the mega drop-down demo but that is defined in the aspx.cs file but my problem is that the level 2 menu has to be constructed in code and the mega drop-down is then level 3.

    How can I create a menuItem based on a template?
  2. Answer
    Kate
    Admin
    Kate avatar
    1898 posts

    Posted 21 May 2012 Link to this post

    Hello Paul,

    Please take a look at the following help article where it is exemplified how you can add Itemtemplate to a menu item from code behind:
    http://www.telerik.com/help/aspnet-ajax/menu-templates-runtime.html 
    The approach should be the same no matter of the menu items level. 

    Regards,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul
    Paul avatar
    55 posts
    Member since:
    Nov 2010

    Posted 21 May 2012 Link to this post

    Thanks Kate that works. At the moment I am having a problem with postbacks because the menu constructed with the code doesn't persist and is lost. However, other than that it is working and I can construct and apply the templates
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 23 May 2012 Link to this post

    Hello Paul,

    Please have a look at the following post that might give you an idea of why your control is getting lost over the postbacks of the page:
    http://couldbedone.blogspot.com/2007/06/dynamically-created-controls-in-aspnet.html

    Greetings,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top