Radzen Tree checkbox Tri-State appears in CheckedValues results #704

Closed
opened 2026-01-29 17:41:51 +00:00 by claunia · 1 comment
Owner

Originally created by @ArjR on GitHub (Jan 20, 2023).

Describe the bug
When selecting a parent node which selects all child nodes as well, and then deselecting child nodes gradually one by one, the parent node (now in Tri-State) is still in the CheckedValues result. This behaves differently if you were to just select a child node as only the child node will appear in CheckedValues result.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://blazor.radzen.com/tree-checkboxes?theme=standard
  2. Expand out "Beverages"
  3. Click "Beverages"
  4. Untick all child nodes other than "Chai"
  5. Console log displays "CheckedValues Changed Beverages Chai"
  6. So both "Beverages" and "Chai" are inside CheckedValues.
  7. Reloading the page and only clicking "Chai" instead gives "CheckedValues Changed Chai"

Expected behavior
Consistent CheckedValues in either cases

Screenshots
Reloading page and click "Beverages":
image

Untick all children other than "Chai":
image

However reloading the page but only clicking "Chai":
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 109.0.5414.75 (Official Build) (64-bit)

Additional context
Add any other context about the problem here.

Originally created by @ArjR on GitHub (Jan 20, 2023). **Describe the bug** When selecting a parent node which selects all child nodes as well, and then deselecting child nodes gradually one by one, the parent node (**now in Tri-State**) is still in the CheckedValues result. This behaves differently if you were to just select a child node as only the child node will appear in CheckedValues result. **To Reproduce** Steps to reproduce the behavior: 1. Go to https://blazor.radzen.com/tree-checkboxes?theme=standard 2. Expand out "Beverages" 3. Click "Beverages" 4. Untick all child nodes other than "Chai" 5. Console log displays "CheckedValues Changed Beverages Chai" 6. So both "Beverages" and "Chai" are inside CheckedValues. 7. Reloading the page and only clicking "Chai" instead gives "CheckedValues Changed Chai" **Expected behavior** Consistent CheckedValues in either cases **Screenshots** Reloading page and click "Beverages": ![image](https://user-images.githubusercontent.com/12074426/213600909-aca0ede8-deeb-4a2b-8595-ff927570a0c0.png) Untick all children other than "Chai": ![image](https://user-images.githubusercontent.com/12074426/213601040-e621221a-54c3-4385-be28-1b7a3d4e6af6.png) However reloading the page but only clicking "Chai": ![image](https://user-images.githubusercontent.com/12074426/213601129-92cbd7ae-564e-42d9-a7f9-6c3d13dec9d3.png) **Desktop (please complete the following information):** - OS: Windows 10 - Browser Chrome - Version 109.0.5414.75 (Official Build) (64-bit) **Additional context** Add any other context about the problem here.
Author
Owner

@AntonioGodoy commented on GitHub (Mar 1, 2023):

At least in version 4.7.1, some weird things happen if you don't supply your own IEnumerable with @bind-CheckedValues parameter.
For example, when you check an item's checkbox, its parent's checkbox is not affected (doesn't refresh) until you close its branch. By using @bind-CheckedValues parameter it works fine.

(I think the issue you present here may have the same cause. May be I'm wrong and should have created a new Issue thread instead. Excuse me if this is the case).

@AntonioGodoy commented on GitHub (Mar 1, 2023): At least in version 4.7.1, some weird things happen if you don't supply your own IEnumerable with `@bind-CheckedValues` parameter. For example, when you check an item's checkbox, its parent's checkbox is not affected (doesn't refresh) until you close its branch. By using `@bind-CheckedValues` parameter it works fine. (I think the issue you present here may have the same cause. May be I'm wrong and should have created a new Issue thread instead. Excuse me if this is the case).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#704