Class RadzenTreeLevel
Configures a level of nodes in a RadzenTree during data-binding.
public class RadzenTreeLevel : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender
- Inheritance
-
RadzenTreeLevel
- Implements
- Inherited Members
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);
}
}
Constructors
RadzenTreeLevel()
public RadzenTreeLevel()
Properties
Checkable
Determines the if the checkbox of the child item can be checked.
[Parameter]
public Func<object, bool> Checkable { get; set; }
Property Value
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.
[Parameter]
public string CheckableProperty { get; set; }
Property Value
ChildrenProperty
Specifies the name of the property which returns child data. The value returned by that property should be IEnumerable
[Parameter]
public string ChildrenProperty { get; set; }
Property Value
Expanded
Determines if a child item is expanded or not. Set to value => false
by default.
[Parameter]
public Func<object, bool> Expanded { get; set; }
Property Value
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.
[Parameter]
public Func<object, bool> HasChildren { get; set; }
Property Value
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.
[Parameter]
public Func<object, bool> Selected { get; set; }
Property Value
Examples
<RadzenTreeLevel Selected=@(e => (e as Employee).LastName == "Fuller") />
Template
Gets or sets the template.
[Parameter]
public RenderFragment<RadzenTreeItem> Template { get; set; }
Property Value
Text
Determines the text of a child item.
[Parameter]
public Func<object, string> Text { get; set; }
Property Value
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.
[Parameter]
public string TextProperty { get; set; }
Property Value
Tree
The RadzenTree which this item is part of.
[CascadingParameter]
public RadzenTree Tree { get; set; }