DxTreeView.NameExpression Property

OBSOLETE

This property is obsolete now. Add the DataMappings tag to markup, define a collection of DxTreeViewDataMapping items, and map item properties to data source fields instead.

Specifies an expression that returns a node’s name.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

[Browsable(false)]
[Obsolete("This property is obsolete now. Add the DataMappings tag to markup, define a collection of DxTreeViewDataMapping items, and map item properties to data source fields instead.")]
[Parameter]
public Expression<Func<object, string>> NameExpression { get; set; }

Property Value

Type Description
Expression<Func<Object, String>>

A lambda expression that returns a node’s unique identifier (name).

Remarks

When the DxTreeView component is bound to a data source, use the NameExpression property to specify lambda expression that returns a node’s name.

<DxTreeView Data="@ChemicalElements" 
            TextExpression="@(dataItem => ((ChemicalElementGroup)dataItem).Title)"
            NameExpression="@(dataItem => ((ChemicalElementGroup)dataItem).Name)"
            NavigateUrlExpression="@(dataItem => ((ChemicalElementGroup)dataItem).Url)"
            IconCssClassExpression="@(dataItem => ((ChemicalElementGroup)dataItem).Icon)"
            ChildrenExpression="@(dataItem => ((ChemicalElementGroup)dataItem).Groups)">
</DxTreeView>

Online Demo

TreeView - Binding to Hierarchical Data

See Also