RadMenu Templates DataBinding

2 posts, 0 answers
  1. Asa'ad
    Asa'ad avatar
    77 posts
    Member since:
    May 2011

    Posted 14 Jun 2011 Link to this post

    Hi All,
    i have a radmenu on my page this is binded to a datatable at run time....
    using the following code
    dt = method call to get data from database ......

    RadMenu1.DataSource = dt;

    RadMenu1.DataFieldID =

     

    "ID";

     

     

    RadMenu1.DataFieldParentID =

     

    "Parent_ID";

     

     

    RadMenu1.DataTextField =

     

    "Text";

     

     

    RadMenu1.DataNavigateUrlField =

     

    "URL";

     

     

    RadMenu1.DataBind();

    and it works fine....

    i have two questions:-

    1- I need to use templates in this menu to add items as hyperlinks for example... Is there any way to add the itemtemplate at run time?

    2- How can i bind a radmenu to sitmap  that is also bounded at run time(by code) as the above example?


    i will appreciate any help...
    Thanks....



  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 16 Jun 2011 Link to this post

    Hello Asa'ad,

    To answer your first question, yes you can add the ItemTemplate at runtime, you can refer to this help topic for more information:

    http://www.telerik.com/help/aspnet-ajax/menu-templates-runtime.html

    To answer your second question, if you're generating the SiteMap datasource at runtime and it's added to the page, you can just set the the DataSourceID to the SiteMap's ID.

    I hope that helps.
Back to Top