I have a tree like in the code below. Is it possible to have a click on the caption (with the icon and label) to expand/collapse the TreeItem?
<RadzenTree Data=@BrightSpaceGroupCategoryAndGroups>
@foreach (var keyValuePair in BrightSpaceGroupCategoryAndGroups)
{
<RadzenTreeItem Text=@keyValuePair.Key.Name Value=@keyValuePair.Value>
<Template>
<div>
<RadzenCheckBox TValue="bool?"
Change=@(args => CategorySelectionChanged(args, keyValuePair.Key.GroupCategoryId))
Value=@keyValuePair.Key.Selected />
<RadzenIcon Icon="link" Visible=@keyValuePair.Key.IsLinked />
<RadzenLabel Text=@keyValuePair.Key.Name />
</div>
</Template>
<ChildContent>
@foreach (var group in keyValuePair.Value)
{
<RadzenTreeItem Text="@group.Name" Value=@group.GroupId HasChildren="true">
<Template>
<div>
<RadzenCheckBox TValue="bool"
Change=@(args => GroupSelectionChanged(args, group.GroupId))
Value=@group.Selected
class="grouptreeitemnochildren" />
<RadzenIcon Icon="link" Visible=@group.IsLinked />
<RadzenLabel Text=@group.Name />
</div>
</Template>
<ChildContent>
@foreach (var schedulingGroup in group.SchedulingGroups)
{
<div class="smallbutton"
@key="schedulingGroup"
@onclick="() => UnlinkFromBrightSpace(schedulingGroup.ExtId, group.GroupId.ToString())">
<RadzenLabel Text=@schedulingGroup.Name />
<RadzenIcon Icon="highlight_off" />
</div>
}
</ChildContent>
</RadzenTreeItem>
}
</ChildContent>
</RadzenTreeItem>
}
</RadzenTree>