Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxTreeView.ChildrenExpression 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 children.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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, 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.

Razor
<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