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

DataNavigateURL to get DataFieldId as parameter

1 Answer 71 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 13 Jul 2009, 02:37 AM
Hello,

I have something I am sure has been done 1000 times before but I couldn't find a sample.  Databind a menu but I want to pass the DataFieldId as a parameter to my destination page of the menu item being clicked.  For example:

Menu option Products
Sub menu options of all product catagories

If I click a product category, I want the destination url to be "ShowProdsInCat.aspx?ProdCat=XXX" where XXX is the ID of the menu option clicked.  How do I best set this up?  Should I update the destinationurl in the ItemCreated event?

Thanks,
Paul

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 15 Jul 2009, 11:05 AM
Hello Paul,

The ideal place to do this is the ItemDataBound event.

Here is a sample:

protected void RadMenu1_ItemDataBound(object  sender, RadMenuEventArgs e) 
 DataRowView row = (DataRowView)e.Item.DataItem; 
 e.Item.NavigateUrl = "ShowProductCat.aspx?ProdCat=" + row["Available"].ToString(); 
}  

I hope this helps.

Regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Menu
Asked by
Paul
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or