DxTreeViewBase.ChildrenExpression Property

Specifies an expression that returns a node’s children.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.dll

Declaration

[Parameter]
public Expression<Func<object, IEnumerable>> ChildrenExpression { get; set; }

Property Value

Type Description
Expression<Func<Object, IEnumerable>>

A lambda expression that returns a node’s children.

Remarks

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

        <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