Tab

ASPxTreeView.NavigateUrlField Property

Gets or sets the name of a data field (or an xml element’s attribute) which provides node navigate URLs.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.1.dll

Declaration

[DefaultValue("")]
public string NavigateUrlField { get; set; }

Property Value

Type Default Description
String

String.Empty

A string value that specifies the name of the required data source field.

Remarks

The NavigateUrlField property is in effect if the ASPxTreeView control is bound to a data source.

Use the NavigateUrlField property to specify the bound data source’s data field (or an xml element’s attribute) which stores node navigate URLs. The NavigateUrlField property maps the TreeViewNode.NavigateUrl properties of TreeViewNode objects to the specified data field’s values.

You can format the obtained navigate locations by using the ASPxTreeView.NavigateUrlFormatString property.

If the NavigateUrlField property of a data bound ASPxTreeView control is not defined, the control can automatically obtain node navigate URLs from a data field whose name is “NavigateUrl” (which is equal to the TreeViewNode.NavigateUrl property’s name).

Example

In this code, the ASPxTreeView is bound to an XML file using a standard XmlDataSource component. The ASPxTreeView’s TextField, ImageUrlField, and NavigateUrlField properties are used to specify the names of data item attributes from which the corresponding node settings should be obtained. The NodeDataBound event is handled to change the text style of nodes which represent classes (their text is displayed in bold).

using DevExpress.Web.ASPxTreeView;
using System.Xml;

public partial class TreeView_DataBinding : Page {
    protected void Page_Load(object sender, EventArgs e) {
        if (!IsPostBack) {
            treeView.DataBind();
            treeView.ExpandToDepth(0);
        }
    }

    protected void treeView_NodeDataBound(object s