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

TreeViewNode.Template Property

Gets or sets a template used for displaying the content of the particular node.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

[DefaultValue(null)]
public virtual ITemplate Template { 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 node’s content.

Remarks

Use the Template property to control the contents of the particular node. The template defined using this property replaces the content of a node - in particular, the node’s check box, image and specified text.

In order to define a common content for all nodes within an ASPxTreeView control, the ASPxTreeView.NodeTemplate property can be used.

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 composing 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