Skip to main content
A newer version of this page is available. .
Tab

ASPxTreeView.NodeTextTemplate Property

Gets or sets a common template used for displaying the text content of all nodes within an ASPxTreeView control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

[DefaultValue(null)]
public virtual ITemplate NodeTextTemplate { get; set; }

Property Value

Type Default Description
ITemplate *null*

An object supporting the System.Web.UI.ITemplate interface, which contains the template used for displaying the text content of all nodes within an ASPxTreeView.

Remarks

Use the NodeTextTemplate property to define a common text content for all nodes within an ASPxTreeView control. The template created using this property replaces the text content of each node within the menu - in particular, the node’s specified text.

Note that any style settings defined for the nodes via specific properties (such as the TreeViewStyles.Node) are still in effect for the nodes whose contents are specified through using the NodeTextTemplate property.

The text content of an individual node can be defined using the node’s TreeViewNode.TextTemplate property.

Note

Once a template defined by this property is created, it is instantiated within a container represented by the TreeViewNodeTemplateContainer class. The TreeViewNodeTemplateContainer class implements a set of properties which can be useful when designing a template and binding the controls comprising this template, to data.

Example

This example demonstrates how you can create templates.

Note

A complete sample project is available at https://github.com/DevExpress-Examples/how-to-create-templates-e2511

protected void Page_Load(object sender, EventArgs e)
{
    ASPxTreeView1.ExpandAll();
}
See Also