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