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

Can I create a complex menu

3 Answers 61 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 20 May 2012, 07:03 PM
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?

3 Answers, 1 is accepted

Sort by
0
Accepted
Kate
Telerik team
answered on 21 May 2012, 10:39 AM
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.
0
Paul
Top achievements
Rank 1
answered on 21 May 2012, 11:22 AM
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
0
Kate
Telerik team
answered on 23 May 2012, 05:54 PM
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.
Tags
Menu
Asked by
Paul
Top achievements
Rank 1
Answers by
Kate
Telerik team
Paul
Top achievements
Rank 1
Share this question
or