DataNavigateURL to get DataFieldId as parameter

2 posts, 0 answers
  1. Paul
    Paul avatar
    31 posts
    Member since:
    Sep 2012

    Posted 12 Jul 2009 Link to this post


    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?


  2. Veselin Vasilev
    Veselin Vasilev avatar
    2992 posts

    Posted 15 Jul 2009 Link to this post

    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.

    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.
  3. DevCraft R3 2016 release webinar banner
Back to Top