Treeview with checkboxes with no parent/child dependencies

Is it possible (perhaps through an override) to unwire the Treeview's checkboxes as far as their parent/child relationships go? In other words, a Treeview is desired for its hierarchical display purpose, but then the user wants to be able to select any combination of items from that Treeview (via the checkboxes) without any of the other checkboxes being altered at all. Typically, if you select a parent item's checkbox, all of its child checkboxes also get automatically checked (we wish to bypass that). And similarly, if you check a child item, it's parent's checkbox gets semi-checked (dash) and its parent checkbox, and so forth (we also wish to bypass that).

So is it possible to override the tree dependency relationships as far as the checkboxes go and just have them all act independently of each other? Thanks!

I just found AllowCheckChildren and AllowCheckParents. They look like exactly what I need. Trying them out now - will report back momentarily...

Almost, but not quite. If you set both AllowCheckChildren="false" and AllowCheckParent="false", parent checkboxes still switch to a dash when an incomplete set of children are checked. But when all of the children are checked, the parent checkbox reveals its own checked state (which could be true or false). The overall problem here is the dash - if it never was displayed in this scenario, that would be great since it occludes whether that item is actually checked or unchecked - and while it is displayed, it also prevents that item's checked state from being toggled itself since clicking on the dash does not change the checkbox's state.

So... Is there any way to prevent the dash from displaying in a parent checkbox? (the dash being the partially-checked-children indicator)

Hi @Jeff.Andrews,

At the moment AllowCheckParent=false seems to still set indeterminate state (the dash). We should probably not be doing that. I will investigate further.

1 Like

I pushed a new commit which should hopefully address the problem. The parent will not be in indeterminate when AllowCheckParent is set to false. Should go live with the next release of Radzen.Blazor.

1 Like

Thank you very much!

I have verified that this now functions in the independent manner we expected it to when AllowCheckParent=false. I am using today's release from the NuGet package of Radzen.Blazor 3.18.12 which appears to correspond to the downloadable 2.68.12 on the Radzen website.

Thanks again for updating this!