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

How to bind Childnode in RadMenu Control

4 Answers 131 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Pravat
Top achievements
Rank 1
Pravat asked on 22 Apr 2009, 09:07 AM

I want to bind below datatable into a radmenu control with sub node.Please help me with some sample code.

Menu should be generate like below.
Campaigns & Program
-> Advertising->Bundel, Business Class, Etc
Tactics & Branded Example -> Adverting And Design->Bill Insert, Billboard, etc


My datatable contain following data-

ID          Title                                              Parent      Level       sno         Root        URL                
----------- -------------------------------------------------- ----------- ----------- ----------- ----------- --------------------
1           Campaigns and Programs                  0           1           1           1           CampaignHeader.aspx  
5           Tactics and Branded Ex                      0           1           1           2           TacticHeader.aspx
6           Advertising and Design                       5           2           1           2           home_page.aspx  
6           Advertising and Desi                           5           2           1           2           home_page.aspx  
7           Bill Insert                                             6           3           2           2           NULL    
7           Bill Insert                                             6           3           2           2           NULL      
8           Brand Standards                                 0           1           1           3           BrandStandardsHome.aspx      
11          Call Tracker                                       1           2           3           1           NULL  
11          Call Tracker                                       1           2           3           1           NULL  
16          Research                                           0           1           1           4           ResearchHome.aspx
17          Resources                                         0           1           1           5           ResourcesHome.aspx
18          Collateral and Office                          5           2           3           2           home_page.aspx   
18          Collateral and Office                          5           2           3           2           home_page.aspx   
25          Billboard                                            6           3           3           2           NULL             
25          Billboard                                           6           3           3           2           NULL             
26          Buck Slips                                        6           3           25          2           NULL             
30          Door Hanger                                    6           3           25          2           NULL             
30          Door Hanger                                    6           3           25          2           NULL             
31          eMarketing                                       6           3           25          2           NULL             
32          Core Brand Elements                       8           2           1           3           home_page.aspx   
32          Core Brand Elements                       8           2           1           3           home_page.aspx   
33          Communication Materials                 8           2           2           3           home_page.aspx   
33          Communication Materials                 8           2           2           3           home_page.aspx   
36          Brand Awareness & Image               16          2           1           4           #                
36          Brand Awareness & Image               16          2           1           4           #                
37          Affiliates                                            17          2           1           5           home_page.aspx   
37          Affiliates                                           17          2           1           5           home_page.aspx   
38          Logo Usage                                      32          3           1           3                            

I have tried with below code but it is not working.

 

RadMenu2.DataSource = dt

 

 

 RadMenu2.DataFieldParentID = "Parent"

 

 

 

 ''Set Text, Value, and NavigateUrl:

 

 

 

 RadMenu2.DataTextField = "Title"

 

 

 

RadMenu2.DataValueField = "ID"

 

 

 

 RadMenu2.DataNavigateUrlField = "URL"

 

RadMenu2.DataBind()

Thanks

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 27 Apr 2009, 01:28 PM
Hello Pravat,

I hope the links which shows how to bind with DataSet, DataTable, and DataView would be helpful to you.
Binding to DataSet, DataTable, and DataView
Using DataBindings

Thanks,
Princy.
0
Pravat
Top achievements
Rank 1
answered on 29 Apr 2009, 04:59 AM
Hi Princy,
                Thanks for ur help. it is working fine.

Thanks,
Pravat
0
bunty
Top achievements
Rank 1
answered on 03 Jun 2009, 12:01 AM
Princy, Thanks for the link. That did it for me.
0
Keshava
Top achievements
Rank 1
answered on 17 Apr 2015, 06:15 AM

Hi,

I need to display menu items in RadMenu control in MVC on view which I have fetched using store procedure.

return View(listAllMenus);  this line from controller I am returning to View. in View I need to display the main menu items and its child items which is present in this listAllMenus. Please he me to solve this using razor View.

keshava1990@gmail.com 

 Thanks

Tags
Menu
Asked by
Pravat
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Pravat
Top achievements
Rank 1
bunty
Top achievements
Rank 1
Keshava
Top achievements
Rank 1
Share this question
or