DxTreeView.NodeTextTemplate Property

Specifies the common template for the text in the TreeView node labels.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll


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

Property Value

Type Description

The template content.


The NodeTextTemplate property allows you to specify a template for the text of all TreeView nodes. Use the template’s context parameter to access an ITreeViewNodeInfo object that stores information about a node (text, level, bound data item, and so on).

The following example demonstrates how to specify node label text in the NodeTextTemplate:

<DxTreeView @ref="@treeView"
            CssClass="demo-treeview-template w-100">
        <DxTreeViewDataMapping Children="ComponentSets" />
            var dataItem = (ComponentSet)context.DataItem;

@code {
    DxTreeView treeView;
    protected override Task OnAfterRenderAsync(bool firstRender)
        if (firstRender)
        return base.OnAfterRenderAsync(firstRender);

TreeView NodeTextTemplate

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

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

Run Demo: TreeView - Templates

See Also