DxTreeViewNode.TextTemplate Property

Specifies the template to display a node's text.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.dll

Declaration

[Parameter]
public RenderFragment<ITreeViewNodeInfo> TextTemplate { get; set; }

Property Value

Type Description
RenderFragment<ITreeViewNodeInfo>

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

Remarks

In the TreeView's unbound mode, use the TextTemplate property to customize an individual node's text.

The following example demonstrates how to apply bold formatting to the root node only:

<DxTreeView>
    <Nodes>
        <DxTreeViewNode Name="Components" Text="Components">
            <TextTemplate>
                <b>@context.Text</b>
            </TextTemplate>
            <Nodes>
                <DxTreeViewNode Name="DataGrid" Text="Data Grid" />
                <DxTreeViewNode Name="PivotGrid" Text="Pivot Grid" />
                ...
            </Nodes>
        </DxTreeViewNode>
    </Nodes>
</DxTreeView>

Blazor-TreeViewNode-TextTemplate

The Template property allows you to specify a template for an individual node's content.

To specify common templates for all TreeView nodes, use the DxTreeView.NodeTextTemplate and DxTreeView.NodeTemplate properties.

See Also