With a databound tree, the creation of node objects is deferred until its parent becomes visible. This makes sense to be the default behavior, but can the lazy instantiation be disabled?
I would like to walk the tree up and down to apply checked state logic but find I cannot follow the Nodes collection down to the leaf nodes unless the tree is expanded. Further, as soon as a new item is added to the datasource I need InitializeDataNode to fire in order to apply an initial checked state.
Is there a property I have overlooked to turn off deferred node creation?
I'm on the latest and greatest of 11.2.
Thanks!
Hello,
In order to clarify this scenario the documentation about this property will be updated as soon as it is possible. If you have any further questions regarding Infragistics Components, please do not hesitate to contact with us.
Thank you for using Infragistics Components.
Hi,
The HasNodes property is behaving correctly, but if this is not documented, then you are correct, it certainly should be. I have forwarded this thread over to our documentation folks so they can get it corrected.
As pointed out in my last reply, I am able to just walk the Nodes collections to force the Node creation, so I no longer have an issue.
My remaining point was that the HasNodes property is wrong and/or misleading because its value is dependent on if the Nodes collection has been accessed to force the Node creation.
Either HasNodes should explicitly document this caveat or the accessing of HasNodes should force the Node generation itself.
Hello,
I am just checking about the progress of this issue. Let me know If you need my further assistance on this issue?
Hello ,
I am agree with you, and instead ultraTree1.Nodes[0].HasNodes you could use ((bool) (ultraTree1.Nodes[0].Nodes.Count >0), this will perform the tree to load child nodes and will give you information if this node has child nodes.
Please let me know if you have any further questions.