Menu / Mega Drop-Down created dynamically from SQL

3 posts, 1 answers
  1. Rob
    Rob avatar
    4 posts
    Member since:
    Sep 2012

    Posted 05 Oct 2012 Link to this post

    I am having issues trying to figure out how to create a mega menu dynamically from SQL server.
    I have a normal telerik menu working fine from SQL.  My SQL server is setup using a Parent Child to create the sub menus.


    <telerik:RadMenu id="globalNavigation" runat="server"






















    SQL Table is setup (as an example)
    idMenuID  vcName     inParentID     URL 
    1         Home         NULL         ~/default.aspx
    2         Country      NULL         ~/Country/default.aspx 
    3         Training     NULL         ~/Training/default.aspx
    4         Student      NULL         ~/Student/default.aspx
    11        Option A     2           ~/Country/defaultA.aspx
    12        Option B    2            ~/Country/defaultB.aspx

    Within the radmenu of a mega drop down it includes
    <telerik:RadMenuItem Text="Products" PostBack="false">


     <telerik:RadMenuItem CssClass="Products" Width="640px">


     <div id="CatWrapper" class="Wrapper" style="width: 435px;">



     <telerik:RadSiteMap ID="RadSiteMap1" runat="server" Skin="Hay" EnableTextHTMLEncoding="true">


     <telerik:SiteMapLevelSetting Level="0">

     <ListLayout RepeatColumns="2" RepeatDirection="Vertical" />




     <telerik:RadSiteMapNode NavigateUrl="#" Text="Student">


     <telerik:RadSiteMapNode NavigateUrl="#" Text="ITO Student PTO" />

     <telerik:RadSiteMapNode NavigateUrl="#" Text="Review of All ITO's" />



     <telerik:RadSiteMapNode NavigateUrl="#" Text="Decor">


     <telerik:RadSiteMapNode NavigateUrl="#" Text="Bed Linen" />

     <telerik:RadSiteMapNode NavigateUrl="#" Text="Throws" />

     <telerik:RadSiteMapNode NavigateUrl="#" Text="Curtains & Blinds" />

     <telerik:RadSiteMapNode NavigateUrl="#" Text="Rugs" />

     <telerik:RadSiteMapNode NavigateUrl="#" Text="Carpets" />









    This is within the Mega Drop Menu.   How would I create these item dynamically.  Would someone have an example of how to write this within the code behind or created dyanmically.

  2. Rob
    Rob avatar
    4 posts
    Member since:
    Sep 2012

    Posted 07 Oct 2012 Link to this post

    I was hoping for a reply from a Telerik developer.  Basically how to create a mega drop down list server side using a SQL server.   
  3. Answer
    Boyan Dimitrov
    Boyan Dimitrov avatar
    2062 posts

    Posted 09 Oct 2012 Link to this post

    Hello Robert,

    I prepared a sample project based on the provided markup code. RadSiteMap control is bound to SQL data source and loads dynamically. It uses table named Links that has additional column URL, so I believe it fits your requirements. Please find the attached project.

    I hope that you will find it helpful.

    Kind regards,
    Boyan Dimitrov
    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