# RadzenTreeLevel Class

Configures a level of nodes in a [RadzenTree](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenTree.md) during data-binding.

Namespace: [Radzen.Blazor](https://blazor.radzen.com/docs/api/Radzen.Blazor.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- ComponentBase
- RadzenTreeLevel

## Implements

- IComponent
- IHandleEvent
- IHandleAfterRender

## Syntax

```csharp
public class RadzenTreeLevel : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender
```

## Examples

```razor
<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

| Constructor | Description |
|-------------|-------------|
| `public RadzenTreeLevel()` | Configures a level of nodes in a [RadzenTree](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenTree.md) during data-binding. |

## Properties

| Property | Type | Description |
|------|------|-------------|
| Checkable | `Func<object, bool>` | Determines the if the checkbox of the child item can be checked. |
| CheckableProperty | `string` | Specifies the name of the property which provides values for the Checkable property of the child items. |
| ChildrenProperty | `string` | Specifies the name of the property which returns child data. The value returned by that property should be IEnumerable |
| Expanded | `Func<object, bool>` | Determines if a child item is expanded or not. Set to value => false by default. |
| HasChildren | `Func<object, bool>` | Determines if a child item has children or not. Set to value => true by default. |
| Selected | `Func<object, bool>` | Determines if a child item is selected or not. Set to value => false by default. |
| Template | `RenderFragment<RadzenTreeItem>` | Gets or sets the template. |
| Text | `Func<object, string>` | Determines the text of a child item. |
| TextProperty | `string` | Specifies the name of the property which provides values for the Text property of the child items. |
| Tree | [`RadzenTree`](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenTree.md) | The RadzenTree which this item is part of. |

### Checkable example

```razor
<RadzenTreeLevel Checkable=@(e => (e as Employee).LastName != null) />
```

### Expanded example

```razor
<RadzenTreeLevel Expanded=@(e => (e as Employee).Employees1.Any()) />
```

### HasChildren example

```razor
<RadzenTreeLevel HasChildren=@(e => (e as Employee).Employees1.Any()) />
```

### Selected example

```razor
<RadzenTreeLevel Selected=@(e => (e as Employee).LastName == "Fuller") />
```

### Text example

```razor
<RadzenTreeLevel Text=@(e => (e as Employee).LastName) />
```

## Inherited Members

- From ComponentBase: Assets, AssignedRenderMode, BuildRenderTree, DispatchExceptionAsync, InvokeAsync, OnAfterRender, OnAfterRenderAsync, OnInitialized, OnInitializedAsync, OnParametersSet, OnParametersSetAsync, RendererInfo, SetParametersAsync, ShouldRender, StateHasChanged

