We help IT Professionals succeed at work.

Treeview - Nodes without parent nodes

LJG
LJG asked
on
>>>If<<<
   In the below tree view I only brought in two children of the Root (Red arrows)
      Level-1-A
      Level-1-C

   and I >>did not<< bring in:
      Level-1-B  (Green arrow)- but I messed up and brought in all the children  (Blue arrows), grandchildren etc of Level-1-B

The Questions:
1) It appears it doesn't hurt anything if I do bring in the children etc of Level-1-B.  They just don't show.  (I understand it will take longer to load the tree because of my mistake)

2) Is the data anyplace in the tree or does the tree control just ignore the data?  
TreeSample.bmp
Comment
Watch Question

Dale FyeOwner, Dev-Soln LLC
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2010

Commented:
There would be no way to "bring in" the Level 2-B nodes, because there would be no parent node to assign them to, and you must assign them to either the Root or to another node.
LJG

Author

Commented:
fyed:
Thanks for the response.  The reason I ask the question is that I have a treeview with 5 levels and by mistake I limited level 2 but didn't limit the children nodes.

I thought I would get an error, or data on the tree would be wrong - neither happened.


So it would appear to me the treeview takes care of my mistake and just disregards the extra data - no harm no foul. (with the exception of increased loading time)

So the question - is the above statement correct or am I missing something?

Thanks in advance for any thoughts.
Dale FyeOwner, Dev-Soln LLC
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2010

Commented:
I still don't understand what you mean by "I limited level 2 but didn't limit the children nodes"

Can you post the code you are using, or better yet, a copy of your database with just the applicable data, form(s) and code?
LJG

Author

Commented:
The code does a lot so let's see if I can do a better job of explaining.  Hopefully if you look at the graphic, the below makes sense.  

A) So if I bring in the Root then run query 1 through 5 I get the original graphic.

B) If I run everything the same as -A- but in step -1- below the query only brings in
      Level-1-A
      Level-1-C

     I don't bring in Level-1-B in step -1- but I bring in all the children and grand children in steps 2 thru 5 that should go under Level-1-B.  I get the below graphic.

So it would appear to me the treeview takes care of my mistake and just disregards the extra data - no harm no foul. (with the exception of increased loading time)

Thanks again for your time.
LJG
--------------- Below is the process ----------------

0) Bring  in Root (I'll call this Level-0)  We now have Root

1) Run a query that brings in the below to the tree under Root  (I'll call this Level-!)
      Level-1-A
      Level-1-B
      Level-1-C

2) Run a query that brings in the below to the tree  (I'll call this Level-2)
      Level-2-B (Under Level-1-A)

      Level-2-B  (Under Level-1-B)
      Level-2-A
      Level-2-A

     Nothing comes in under Level1-C

3) Run a query that brings in the below to the tree  (I'll call this Level-3)
      Level-3-B  (Under Level-2-B)    

4) Run query to bring in  Level-4
      Level-4-B  (Under Level-2-B)

5) Run query to bring in   Level-5
      Level-5-Data_1  (Under Level-4-B)
      Level-5-Data_2
      Level-5-Data_3
      Level-5-Data_4


 Treeview example 2
Commented:
It would appear to me that the treeview ignores any data that does not have a parent.
LJG

Author

Commented:
I either asked the question wrong or no one has an answer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.