Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
198
Adding Nodes at Runtime
posted

I have a tree that is linked to a list of custom objects (myBase).  Each one of these custom objecs has a list of a different custom objects (myChildren). The myBase list conains about 100 objects. Each myBase object contains about 100  myChildren object.  It takes about 30 seconds to load myChildren list for any myBase object.  I don't want to spend 100*30 = 3,000 seconds (50 minutes!) to load the full tree from the begining.  What i do is everytime the user expands the myBase node i read in the list of myChildren (in the BeforeExpand Event).  

Here is the issue 50% of the time when i load the myChildren list it shows up correctly, the other 50% of the time the myCHildren list gets populated but is not reflected in the Tree.  I've tried this with the same data, 50% it works and 50% it doesn't work.

I've tried calling Tree.Refresh,and Tree.DataSource = List(myBase) but it doesn't help.

Is there a way to fix this?