This is a migrated thread and some comments may be shown as answers.

TreeView Problems

2 Answers 594 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Alberto
Top achievements
Rank 1
Alberto asked on 06 Apr 2020, 02:53 PM
I have been testing the Treeview control and found some problems:

1. Lazy Loading doesnt work for more than first-level as in the sample, but if there are more sublevels it doesnt work. Can you explain or put demo how this work?

2. Lazy Loading even on level 0 nodes I expand and unexpand some nodes and it expands some times and others dont.

3. As on demand loading not working well I tried to load everything at first and with a large collection like a directory/subdirectory structure and it didnt work.


See attached data, when loading all data in tree not all treeitems are shown. No errors are given.

2 Answers, 1 is accepted

Sort by
0
Alberto
Top achievements
Rank 1
answered on 06 Apr 2020, 03:08 PM

this is data sample:

[{"Id":1,"Text":"repo1","Path":"\\\\192.168.199.242\\repo1","ParentIdValue":null,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":2,"Text":"\\\\192.168.199.242\\repo1\\publish","Path":"\\\\192.168.199.242\\repo1\\publish","ParentIdValue":1,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":3,"Text":"\\\\192.168.199.242\\repo1\\publish\\logs","Path":"\\\\192.168.199.242\\repo1\\publish\\logs","ParentIdValue":2,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":4,"Text":"\\\\192.168.199.242\\repo1\\publish\\ref","Path":"\\\\192.168.199.242\\repo1\\publish\\ref","ParentIdValue":2,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":5,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes","ParentIdValue":2,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":6,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix","ParentIdValue":5,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":7,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib","ParentIdValue":6,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":8,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1","ParentIdValue":7,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":9,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1\\Modules","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1\\Modules","ParentIdValue":8,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":10,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Host","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Host","ParentIdValue":9,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":11,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Management","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Management","ParentIdValue":9,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":12,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Security","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Security","ParentIdValue":9,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":13,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Utility","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\unix\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Utility","ParentIdValue":9,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":14,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win","ParentIdValue":5,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":15,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib","ParentIdValue":14,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":16,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1","ParentIdValue":15,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":17,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules","ParentIdValue":16,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":18,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\CimCmdlets","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\CimCmdlets","ParentIdValue":17,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":19,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Diagnostics","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Diagnostics","ParentIdValue":17,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":20,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Host","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Host","ParentIdValue":17,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":21,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Management","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Management","ParentIdValue":17,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":22,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Security","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Security","ParentIdValue":17,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":23,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Utility","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.PowerShell.Utility","ParentIdValue":17,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":24,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.WSMan.Management","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\Microsoft.WSMan.Management","ParentIdValue":17,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":25,"Text":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\PSDiagnostics","Path":"\\\\192.168.199.242\\repo1\\publish\\runtimes\\win\\lib\\netcoreapp3.1\\Modules\\PSDiagnostics","ParentIdValue":17,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":26,"Text":"\\\\192.168.199.242\\repo1\\publish\\support","Path":"\\\\192.168.199.242\\repo1\\publish\\support","ParentIdValue":2,"HasChildren":true,"Icon":"far fa-folder","Expanded":false},{"Id":27,"Text":"\\\\192.168.199.242\\repo1\\publish\\tempdata","Path":"\\\\192.168.199.242\\repo1\\publish\\tempdata","ParentIdValue":2,"HasChildren":true,"Icon":"far fa-folder","Expanded":false}]

0
Marin Bratanov
Telerik team
answered on 06 Apr 2020, 05:09 PM

Hi Alberto, 

Could you check if this is the issue you're hitting: https://feedback.telerik.com/blazor/1459796-treeview-does-not-expand-when-using-async-methods? If this is a separate problem, please modify the sample from the public issue page to showcase the difference you are facing. Or, alter the docs, whichever you find easier.

I am also attaching here a small sample app I made based on this data and it works fine for me. I am also adding a short video that demonstrates how it works for me. If comparing against it does not help you move forward, please modify it to showcase the problem.

 

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
TreeView
Asked by
Alberto
Top achievements
Rank 1
Answers by
Alberto
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or