Hi,
I'm trying to implement
LoadOnDemandCommand
in SfTreeGrid.
1st issue - loading roots into the tree not working correctly, only if roots are hardcoded. Without LoadOnDemandCommand works fine.
2nd issue - I'm using async/await to populate children inside LoadOnDemandCommand. Then expanding of nodes not working as I expected
I added code example and video.
Am I something wrong? Thanks for response
Ondrej Rada
Currently, SfTreeGrid doesn’t have support for asynchronous on demand loading. We have considered your requirement of “Provide support for loading items asynchronously in on-demand loading” and logged feature request for the same. We will implement this feature in any of our upcoming release.
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.
Thank you for requesting this feature and helping us define it. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts.
Feedback link: https://www.syncfusion.com/feedback/34559/provide-support-for-loading-items-asynchronously-in-ondemandloading
If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal and cast your vote to make it count.
Hi,
a modified my example to sync variant. Loading roots still not working, only if roots are hardcoded.
Thanks for response
Ondrej Rada
We are unable to reproduce the issue from our
end. Find the modified tested sample.
If you still facing the reported issue modify the attached sample and
share the video illustration of the reported issue. It will be helpful for us
to check on it and provide you with a solution at the earliest.
Hi,
I tried to run attached example but behavior is still same. I expect new roots in tree but there is still only one. Video example attached.
Thanks
Ondrej Rada
Ondrej,
SfTreeGrid allows you to load child items only when they are requested
to load on-demand. Initially populate the root Nodes by assigning
SfTreeGrid.ItemsSource and then when any node is expanded, child items can be
loaded using SfTreeGrid.LoadOnDemandCommand. But in your case, you trying to
populate the root Nodes at run time, which is not possible when using the
LoadOnDemandCommand in SfTreeGrid. So, the reported scenario is not an issue.
This is expected behavior in SfTreeGrid. We have also mentioned in our user
guide documentation link,
UG Link: https://help.syncfusion.com/wpf/treegrid/load-on-demand
Hi,
I do not understand why it is not possible and why it is expected behavior. In my case I need to reload root nodes when UI component (SfTreeGrid) is already loaded. If data was changed and refresh is necessery, my only option is to dispose sftreegrid and reload full component again. It is very sad.
Hi Ondrej,
LoadOnDemandCommand used to load child items only to the rootNodes in the SfTreeGrid upon request.
We need to populate the rootNodes initially, and then when any node is expanded, child items can be loaded using SfTreeGrid.LoadOnDemandCommand.
For more information, find the UG,
https://help.syncfusion.com/wpf/treegrid/load-on-demand#load-on-demand-using-command