How to bind Childnode in RadMenu Control

5 posts, 0 answers
  1. Pravat
    Pravat avatar
    8 posts
    Member since:
    Apr 2009

    Posted 22 Apr 2009 Link to this post

    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

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 27 Apr 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pravat
    Pravat avatar
    8 posts
    Member since:
    Apr 2009

    Posted 28 Apr 2009 Link to this post

    Hi Princy,
                    Thanks for ur help. it is working fine.

    Thanks,
    Pravat
  5. bunty
    bunty avatar
    2 posts
    Member since:
    Jun 2009

    Posted 02 Jun 2009 Link to this post

    Princy, Thanks for the link. That did it for me.
  6. Keshava
    Keshava avatar
    1 posts
    Member since:
    Nov 2014

    Posted 17 Apr 2015 Link to this post

    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

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017