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

RadMenu Templates DataBinding

1 Answer 115 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Asa'ad
Top achievements
Rank 1
Asa'ad asked on 14 Jun 2011, 11:49 AM
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....



1 Answer, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 16 Jun 2011, 01:17 PM
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.
Tags
Menu
Asked by
Asa'ad
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Share this question
or