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

Vertical Sliding Menu

1 Answer 114 Views
Menu
This is a migrated thread and some comments may be shown as answers.
asif rehman
Top achievements
Rank 1
Iron
asif rehman asked on 27 Jul 2014, 05:22 AM
Hello experts i want to create a dynamic menu  from the database just like the one in the following link

http://demos.telerik.com/aspnet-ajax/panelbar/examples/overview/defaultcs.aspx

my table structure is

screen_id , screen_name, parent_id, link
1,"Home",0,"/Home.aspx"
2,"MyContact",1,"/MyContact.aspx"
3,"MyTasks",1,"/MyTasks.aspx"

my problem is that i am not been able to place a sub menu under its parent menu at  e.g. menu id 2 and 3 under menu id 1.In ASP.net i used to use this line Menu1.FindItem(dr["ParentID"].ToString()).ChildItems.Add(mnu); but in Telerik i am not been able to use any of the function "FindItemByValue", "FindItem", "FindItemByText".

if any one can help?

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 30 Jul 2014, 03:20 PM
Hello,

An easy and convenient way to create a RadMenu dynamically from the code behind is demonstrated here.

On the other hand you can create a RadMenu item "Home" and set the item's value to the screen_id value which in this case is "1". Then If you want to add the RadMenu item "MyTasks" as a child item for "Home" you can call the RadMenu method FindItemByValue and pass the MyTasks item parent_id value. Once you have accessed the "Home" RadMenu item you can use Items.Add method.


Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Menu
Asked by
asif rehman
Top achievements
Rank 1
Iron
Answers by
Boyan Dimitrov
Telerik team
Share this question
or