Tab

TreeViewNode.Template Property

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

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.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.

Examples

This example demonstrates how you can create templates.

View Example

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