DataNavigateUrlField and New Windows

4 posts, 0 answers
  1. Richard
    Richard avatar
    16 posts
    Member since:
    Dec 2007

    Posted 19 Feb 2008 Link to this post


    I've succesfully got a databound radmenu working but it our application I need to be able to open aspx pages in named windows i.e. we end up with multiple open windows.

    Is this possible?  There is no target property available in the radmenu and while this is available in the radmenuitem I cant seem to get this to work for a databound menu.


  2. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 20 Feb 2008 Link to this post

    Hello Richard,

    You can use a databinding to specify the Target for all menu items:

    <telerik:RadMenu runat="server" ID="RadMenu1"
            <telerik:RadMenuItemBinding Target="myTarget" /> 

    If the the name of the window is stored in the database (say in a "WindowName" database column) you can use the following databinding:

    <telerik:RadMenu runat="server" ID="RadMenu1"
            <telerik:RadMenuItemBinding TargetField="WindowName" /> 

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft R3 2016 release webinar banner
  4. Simon Allport
    Simon Allport avatar
    32 posts
    Member since:
    Aug 2009

    Posted 21 Sep 2009 Link to this post

    I take it the example does it for all items in the menu , but what if you only want some of the child items to open up in a new window?

    telerik:RadMenu runat="server" ID="RadMenu1"
            <telerik:RadMenuItemBinding TargetField="WindowName" /> 

    Would  'WindowName' for each item be like "_blank" , "_Self" etc... would that then work for above?


  5. Peter
    Peter avatar
    6637 posts

    Posted 25 Sep 2009 Link to this post

    Hello Simon,

    Yes, all items are affected, but the value can be different depending on what comes from the data source. Here is a simple demo to try that uses a fake data table:

    <telerik:RadMenu ID="RadMenu1" runat="server">  
                <telerik:RadMenuItemBinding TargetField="Target" /> 

     private DataTable CreateTestTable()  
            DataTable table = new DataTable();  
            table.Rows.Add(new string[] { "1"null"root 1(opens in new window)""root1.aspx""_blank" });  
            table.Rows.Add(new string[] { "2"null"root 2(opens in same window)""root2.aspx""_self" });  
            table.Rows.Add(new string[] { "3""1""child 1.1(opens in new window) ""child11.aspx""_blank" });  
            table.Rows.Add(new string[] { "4""1""child 1.2(opens in same window)""child12.aspx""_self" });  
            return table;  
        protected void Page_Load(object sender, EventArgs e)  
            if (!IsPostBack)  
                RadMenu1.DataSource = CreateTestTable();  
                //Establish hierarchy:  
                RadMenu1.DataFieldID = "ID";  
                RadMenu1.DataFieldParentID = "ParentID";  
                //Set Text, Value, and NavigateUrl:  
                RadMenu1.DataTextField = "Text";  
                RadMenu1.DataValueField = "ID";  
                RadMenu1.DataNavigateUrlField = "URL";  

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top