DxTreeViewBase.NodeTextTemplate Property

Specifies the common template to display all nodes' text.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.dll


public RenderFragment<ITreeViewNodeInfo> NodeTextTemplate { get; set; }

Property Value

Type Description

The template content for an object of the ITreeViewNodeInfo type that provides information about a node (the text, level, bound data item, etc.)


Use the NodeTextTemplate property to specify a template for the text of all TreeView nodes.

The following example demonstrates how to change the text settings for the root node and specify the multi-line text for other nodes.

<DxTreeView @ref="@treeView"
            ChildrenExpression="@(dataItem => ((ComponentSet)dataItem).ComponentSets)">
            var dataItem = (ComponentSet)context.DataItem;
        @if (!context.IsLeaf)
            <h5 class="mt-0  d-inline-block">@dataItem.Title</h5>
            <div class="media-body">
                <h5 class="mt-0">@dataItem.Title</h5>


The NodeTemplate property allows you to modify the content for all nodes.

In unbound mode, you can also use the DxTreeViewNode.TextTemplate and DxTreeViewNode.Template properties to specify templates for individual nodes.

Online Demo

TreeView - Templates

See Also