This is a migrated thread and some comments may be shown as answers.
Radmenu Databind
3 Answers 43 Views
This is a migrated thread and some comments may be shown as answers.
Indranil
Top achievements
Rank 1
Indranil asked on 01 Sep 2011, 04:57 PM
Hi all i am using a datatable to populate data for the radmenu.
i have a column LINK in my datatable which is used for DataNavigateUrlField, But my problem is i have put my files into  a directory say "Sales"
i.e
sales/ManageCustomer.aspx

but i am inserting only ManageCustomer.aspx in the table. as datatable also contain the ManageCustomer.aspx.
I don't want to give full path Like Sales/ManageCustomer.aspx in the table.
if i give the full path Sales/ManageCustomer.aspx it is working fine.
for this reason i am having problem in case of navigation.
So, What i will do provide the Relative Path for Navigation

 

DataTable

 

dt = _presenter.GetAllMenu();

 

 

radMenu1.DataFieldParentID =

"ParentMenuId";

 

radMenu1.DataFieldID =

"MenuId";

 

radMenu1.DataNavigateUrlField =

"Link";

 

radMenu1.DataTextField =

"MenuName";

 

radMenu1.DataValueField =

"MenuId";

 

radMenu1.DataSource = dt;

radMenu1.DataBind();

 

Please help.

Neel

3 Answers, 1 is accepted

Sort by
0
Gotcha
Top achievements
Rank 1
answered on 04 Sep 2011, 02:21 AM
I;ve just started using telerik controls myself...

If you don't include the "Sales" Folder within the field Link, then you must concatenate the "Sales"+Link from the DataTable.Is there a reason why you do not want to include the full path in your datatable?


0
Indranil
Top achievements
Rank 1
answered on 04 Sep 2011, 09:23 AM
Actually , i can chanhe the Sales Folder or path. as my menus will be fixed but Folder path can be changed.
How can i Provide DataTextField to a value after concatinate Sales+Link

Please help.

Neel
0
Gotcha
Top achievements
Rank 1
answered on 06 Sep 2011, 01:51 AM
The DataTextField ? you mean you want to have the DataNavigateURL resolve to the correct path... where you will need the value of the "Folder" concatenated to the value held in  your current DataNavigateURL ( which i understand is only manageCustomer.aspx)...

In other words,
Assuming folder is initialized to the appropriate folder
folder = "~\Sales\";

radMenu1.DataNavigateUrlField = folder + "\ManageCustomer.aspx"

This is how i would have done it.
HTH

Tags
Menu
Asked by
Indranil
Top achievements
Rank 1
Answers by
Gotcha
Top achievements
Rank 1
Indranil
Top achievements
Rank 1
Share this question
or