Files
radzen-blazor/Radzen.Blazor/RadzenTree.razor
2026-03-04 15:20:37 +02:00

23 lines
820 B
Plaintext

@inherits RadzenComponent
@using Microsoft.AspNetCore.Components.Rendering;
@using System.Collections
@using System.Linq
@if (Visible)
{
<div @ref="@Element" @attributes="Attributes" class="@GetCssClass()" style="@Style" id="@GetId()"
role="tree" aria-multiselectable="@(AllowCheckBoxes ? "true" : null)"
tabindex="0" @onkeydown="@OnKeyPress" @onkeydown:preventDefault=preventKeyPress @onkeydown:stopPropagation="stopKeydownPropagation">
<ul class="rz-tree-container">
<CascadingValue Value=this>
@ChildContent
</CascadingValue>
@if (Data != null && Levels != null && Levels.Any())
{
<CascadingValue Value=this>
@RenderChildren(Data, 0)
</CascadingValue>
}
</ul>
</div>
}