How to get a click on caption of treeviewitem to expand/collapse the item

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>

Hi @PaulSinnema,

You can probably do that by setting the Expanded property of the RadzenTreeItem when the Label is clicked. If possible you can extend the group item to have a corresponding property:

<RadzenTreeItem Text="@group.Name" Value=@group.GroupId HasChildren="true" Expanded=@group.Expanded>
   <Template>
      <RadzenLabel Text=@group.Name @onclick=@(args => Toggle(group)) />
   </Template>

@code {
   void Toggle(MyGroup group)
   {
       group.Expanded = !group.Expanded;
   }
}