issue of Child items in the TreeView

0 Answers 22 Views
TreeView
Ivan Loera
Top achievements
Rank 1
Ivan Loera asked on 15 Jan 2025, 10:48 PM

I am building a tree where my selected boxes appear as input, I followed this example since I just updated my app to Net 8 and updated my Telerik package to the latest version (9.0.0), but I have the problem that only the two parent elements of the tree are selected, I followed this thread https://www.telerik.com/forums/treeview-control-and-setting-individual-items-to-checked that I found in the forum and I see that they presented the same problem that I report, the curious thing is that they mention that in a later version (6.3.0) this error was corrected, could you tell me where I am wrong.

Didi
Telerik team
commented on 16 Jan 2025, 09:51 AM

Hi Ivan,

Thank you for the provided information.

I reviewed the link you shared and the behavior there was related to the following issue which is fixed: https://feedback.telerik.com/maui/1614332-treeview-items-are-coerced-immediately-when-selecteditems-and-checkeditems-collections-are-set-before-itemssource 

Regarding to the behavior you described, I am not sure what is the exact issue. Could you please share whether you use the SelectedItems, or CheckedItems collection, or both? What is the scenario you want to achieve and what is not working?
If you select the parent element, it is added to the SelectedItems collection. If you want to select the child elements to, you have to manually add them to the collection. 

If you check the parent element through the UI, when using a recursive checkbox mode, the child elements are also checked. The CheckedItems and SelectedItems are different collections. 

If you can send a sample project that represents the issue, that could be of help for further researching the case.

No answers yet. Maybe you can help?

Tags
TreeView
Asked by
Ivan Loera
Top achievements
Rank 1
Share this question
or