Blazor Treeview with CheckBoxes Problem with tri state

I*m using your treeview sample with checkboxes. As long as I check a Child everting is ok, the Parent is checked with -, but does not apear in the check items list

But when I check the parant item, and then uncheck one or two child item, the parent item ist still in the list of checked Items


And even worse whenIi hide the treeview and reshow it again the parent is fully checked and all children too

But the behaviour is the same in CheckedValues Condiments is contained


and when I check only the childs Condiment is not in CheckedValues

First screenshot was not complete

Hi @grsgrs,

Even if not checked explicitly, the parent will be part of CheckedValues if all children are checked. Here is an example where the parent is not in CheckedValues since only some of the children are checked:

Here is an example where the parent is part of CheckedValues since all children are checked:

UPDATE: Ok. I've managed to reproduce an invalid state where after all children are checked (and parent is checked explicitly in this case) and a single child is unchecked the parent is still part of CheckedValues while visually the state is correct. Is this what you are reporting?

Here is what I've fixed. The fix will be part of our next update early next week:

Hi enchev I tried Version 4.7.9 from today, and this works now, thank you
But the other issue is still there:
When I hide an reshow the tree all Check Information is lost. I tried to reconstruct the check information after Reshow via saved CheckeValues, but this does not work , because @bind-CheckedValues is not only updatet when a tree item is checked, but also when a treeitem is expandend.

And generally asked: How do I reconstruct the check information from data for intance when I reload from DB.

You can assign new value to the variable two-way bound to CheckedValues

Good Morning enchev
Does this version 4.7.9 already contain your fix? Because just now I saw, that it is only working when a child is checked without the parent be chekced, and not when the parent is checked and then some childs are unchecked

With data binding:
Data binding is only working when the top level tree node is checked. Tehn I can set the tree properly.
But it is not working when only a child node is check, I can demonstrate by Hidind and Reshow the tree
scenario before hiding


scenario after hiding and reshow
The CheckValues are stiil properly set

But when I now expand the dev tree node CheckedValue is reset an alle the information about checked children is gone. and that's the problem Expand resets the CheckeValues

No. The fix is still not released - I already mentioned that it will be released next week. You can check also the commits history for referenced what is included in a release and what not:

There is also a changelog with every release: