Class RadzenTreeLevel
Configures a level of nodes in a RadzenTree during data-binding.
Inheritance
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenTreeLevel : ComponentBase
Examples
<RadzenTree Data=@rootEmployees>
<RadzenTreeLevel TextProperty="LastName" ChildrenProperty="Employees1" HasChildren=@(e => (e as Employee).Employees1.Any()) />
</RadzenTree>
@code {
IEnumerable<Employee> rootEmployees;
protected override void OnInitialized()
{
rootEmployees = NorthwindDbContext.Employees.Where(e => e.ReportsTo == null);
}
}
Properties
Checkable
Determines the if the checkbox of the child item can be checked.
Declaration
public Func<object, bool> Checkable { get; set; }
Property Value
Type | Description |
---|---|
Func<System.Object, System.Boolean> |
Examples
<RadzenTreeLevel Checkable=@(e => (e as Employee).LastName != null) />
CheckableProperty
Specifies the name of the property which provides values for the Checkable property of the child items.
Declaration
public string CheckableProperty { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ChildrenProperty
Specifies the name of the property which returns child data. The value returned by that property should be IEnumerable
Declaration
public string ChildrenProperty { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Expanded
Determines if a child item is expanded or not. Set to value => false
by default.
Declaration
public Func<object, bool> Expanded { get; set; }
Property Value
Type | Description |
---|---|
Func<System.Object, System.Boolean> |
Examples
<RadzenTreeLevel Expanded=@(e => (e as Employee).Employees1.Any()) />
HasChildren
Determines if a child item has children or not. Set to value => true
by default.
Declaration
public Func<object, bool> HasChildren { get; set; }
Property Value
Type | Description |
---|---|
Func<System.Object, System.Boolean> |
Examples
<RadzenTreeLevel HasChildren=@(e => (e as Employee).Employees1.Any()) />
Selected
Determines if a child item is selected or not. Set to value => false
by default.
Declaration
public Func<object, bool> Selected { get; set; }
Property Value
Type | Description |
---|---|
Func<System.Object, System.Boolean> |
Examples
<RadzenTreeLevel Selected=@(e => (e as Employee).LastName == "Fuller") />
Template
Gets or sets the template.
Declaration
public RenderFragment<RadzenTreeItem> Template { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment<RadzenTreeItem> |
Text
Determines the text of a child item.
Declaration
public Func<object, string> Text { get; set; }
Property Value
Type | Description |
---|---|
Func<System.Object, System.String> |
Examples
<RadzenTreeLevel Text=@(e => (e as Employee).LastName) />
TextProperty
Specifies the name of the property which provides values for the Text property of the child items.
Declaration
public string TextProperty { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Tree
The RadzenTree which this item is part of.
Declaration
public RadzenTree Tree { get; set; }
Property Value
Type | Description |
---|---|
RadzenTree |