We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

LoadOnDemandCommand and ChildPropertyName on same SfTreeView

Hi...   


When I use LoadOnDemandCommand and ChildPropertyName on same SfTreeView, the initial ChildNodes are not loaded.
Is there any way to force some ChildNodes to be displayed when opening the page?

To better explain, I've changed the On Demand Load tab in your samples and attached in this post.


Best regards,


Marcel Souza
Pds Informática



Attachment: TreeView_b7597a4c.zip

3 Replies

SP Subburaj Pandian Veluchamy Syncfusion Team January 17, 2019 03:54 PM UTC

Hi Marcel,  
 
Thank you for using Syncfusion Products.  
 
We have checked your query “ChildNodes are not loaded when used LoadOnDemandCommand and ChildPropertyName” from our side. When you set both LoadOnDemandCommand and ChildPropertyName for same SfTreeView, ChildNodes for particular item you needed to load initially while loaded will be loaded. You have to return false in the CanExecute method of LoadOnDemandCommand, for the node to which you have to load ChildNodes initially when loaded.  
To display some ChildNodes when opening the page, you need to set AutoExpandMode property to either AllNodesExpanded or RootNodesExpanded.  
 
You can download the sample from following location.   
   
Please let us know, if you have any query. 
  
Regards,
Subburaj Pandian V  



MA Marcel January 19, 2019 11:27 AM UTC

Hi,

Thank you for your feedback.

In the CanExecute method, I was testing the amount of ChildNodes and  in the first reading was returning true. Now I fixed this and all works great.


JN Jayaleshwari N Syncfusion Team January 21, 2019 05:41 AM UTC

Hi Marcel, 
 
Thanks for the update. Please get in touch if you would require further assistance. 

Regards,
 
Jayaleshwari N. 


Loader.
Live Chat Icon For mobile
Up arrow icon