TreeView Parent/Child Expanded Question 
Author Message
 TreeView Parent/Child Expanded Question

I've an App that uses TreeView.  My data can be in any quantity and order.
I've done my sorting so that the "nodes" are correct.  I get the proper
TreeView of what my data represents.  A portion of my code is thus:

Set nodX = TB4TreeView.Nodes.Add(A$, B$ , C$, D$, 1)
    nodX.Expanded = True

My question is that currently I'm displaying my TreeView Expanded.  Thus both
Parent and Child!  What I would like to do is to ONLY expand Parent nodes!
How does one go about doing this (if it is at all possible).  From what I've
read up on TreeView, I can't figure this out as you do not build the Treeview
specifically figuring out which is a parent and which is a child.

Any tips would be appreciated!

 Regards,
  Bruce

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            I have seen the evidence.  I want DIFFERENT evidence!
             (live from the West End of Vancouver, B.C. Canada)
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 NOTICE: Please CHANGE my address of <NETCA.COM> to <NETCOM.CA> IF you
 ~~~~~~~ send me ANY Email replies.  This was done to STOP all UnSolicted
 ~~~~~~~ JUNK E-Mailings.  Sorry to do this BUT it does stop SPAM Email!



Sun, 18 Nov 2001 03:00:00 GMT  
 TreeView Parent/Child Expanded Question
You could do the expanding once the tree is populated.

Loop through all the nodes of the tree and only expand the nodes that have
chidren
example:

If TreeView1.SelectedItem.Children > 0 Then .....


Quote:
>I've an App that uses TreeView.  My data can be in any quantity and order.
>I've done my sorting so that the "nodes" are correct.  I get the proper
>TreeView of what my data represents.  A portion of my code is thus:

>Set nodX = TB4TreeView.Nodes.Add(A$, B$ , C$, D$, 1)
>    nodX.Expanded = True

>My question is that currently I'm displaying my TreeView Expanded.  Thus
both
>Parent and Child!  What I would like to do is to ONLY expand Parent nodes!
>How does one go about doing this (if it is at all possible).  From what
I've
>read up on TreeView, I can't figure this out as you do not build the
Treeview
>specifically figuring out which is a parent and which is a child.

>Any tips would be appreciated!

> Regards,
>  Bruce

> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>            I have seen the evidence.  I want DIFFERENT evidence!
>             (live from the West End of Vancouver, B.C. Canada)
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> NOTICE: Please CHANGE my address of <NETCA.COM> to <NETCOM.CA> IF you
> ~~~~~~~ send me ANY Email replies.  This was done to STOP all UnSolicted
> ~~~~~~~ JUNK E-Mailings.  Sorry to do this BUT it does stop SPAM Email!



Sun, 18 Nov 2001 03:00:00 GMT  
 TreeView Parent/Child Expanded Question

Quote:
>You could do the expanding once the tree is populated.

>Loop through all the nodes of the tree and only expand the nodes that have
>chidren
>example:

>If TreeView1.SelectedItem.Children > 0 Then .....

I'll give that a try.  Doesn't appear to be any other way that I can see.
Thanks!

 Regards,
  Bruce

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
               I haven't had Sex since 1940!  It is now 20:02!
             (live from the West End of Vancouver, B.C. Canada)
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 NOTICE: Please CHANGE my address of <NETCA.COM> to <NETCOM.CA> IF you
 ~~~~~~~ send me ANY Email replies.  This was done to STOP all UnSolicted
 ~~~~~~~ JUNK E-Mailings.  Sorry to do this BUT it does stop SPAM Email!



Mon, 19 Nov 2001 03:00:00 GMT  
 TreeView Parent/Child Expanded Question
Try TB4TreeView.Nodes(parent key).Expanded = False
Hilal



Quote:

> Subject: TreeView Parent/Child Expanded Question
> Organization: Netcom Canada

> I've an App that uses TreeView.  My data can be in any quantity and
order.
> I've done my sorting so that the "nodes" are correct.  I get the proper
> TreeView of what my data represents.  A portion of my code is thus:

> Set nodX = TB4TreeView.Nodes.Add(A$, B$ , C$, D$, 1)
>     nodX.Expanded = True

> My question is that currently I'm displaying my TreeView Expanded.  Thus
both
> Parent and Child!  What I would like to do is to ONLY expand Parent
nodes!
> How does one go about doing this (if it is at all possible).  From what
I've
> read up on TreeView, I can't figure this out as you do not build the
Treeview
> specifically figuring out which is a parent and which is a child.

> Any tips would be appreciated!

>  Regards,
>   Bruce

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Quote:
>             I have seen the evidence.  I want DIFFERENT evidence!
>              (live from the West End of Vancouver, B.C. Canada)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

- Show quoted text -

Quote:
>  NOTICE: Please CHANGE my address of <NETCA.COM> to <NETCOM.CA> IF you
>  ~~~~~~~ send me ANY Email replies.  This was done to STOP all UnSolicted
>  ~~~~~~~ JUNK E-Mailings.  Sorry to do this BUT it does stop SPAM Email!
> --
> |Fidonet:  UUCP 2:500/3.1

> |
> | Standard disclaimer: The views of this user are strictly his own.



Mon, 19 Nov 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Add Children to Treeview on Expand

2. TreeView : child with multiple parents

3. Select parent or children in treeview

4. Expand TreeView not actually expanding

5. Move Treeview Child Node To Different Parent

6. Get TreeView MouseUp event to recognize parent/child

7. treeview parent or child ?

8. TreeView Drag n Drop don't allow dropping a parent into a child

9. ReOrdering Child nodes Within Parent in treeview

10. Treeview/listview to display Parent-child recordsets

11. Move activex dll child on a MDI parent parent window

12. MDI Question: Two Separate Apps, One Child To Parent App

 

 
Powered by phpBB® Forum Software