TreeView: Can anybody tell me how to use the node references? 
Author Message
 TreeView: Can anybody tell me how to use the node references?

Hi!

I have tried to reference/find nodes in a TreeView by using Child,
FirstSibling etc. for a couple of days now.
I always end up with an error when I try to either reference key values
etc., or assign the reference to a Node variable.

Are there known bugs (I can't find any at MSDN or TechNet) or do you have an
example/a pointer to info that you want to share?

What I am trying to accomplish is finding an insertion point in a treeview
for new data. I look at all nodes at a certain depth of the tree.

Keld Laursen



Tue, 08 Feb 2005 19:12:36 GMT  
 TreeView: Can anybody tell me how to use the node references?
Keld,

please see my reply to your previous post.
One thing I forgot to mention:
I was never able to reference a node in the treeview by
it's Key (string), only by it's Index(Integer).

I assume that this is a bug in the eVB TreeView control.
So in order to find a certain node by it's Key, you really
have to loop through all the nodes and compare their
Key value with the one you are looking for.
In my opinion that is one of the bigger bugs in eVB.

HTH,
Mike


Quote:
> Hi!

> I have tried to reference/find nodes in a TreeView by using Child,
> FirstSibling etc. for a couple of days now.
> I always end up with an error when I try to either reference key values
> etc., or assign the reference to a Node variable.

> Are there known bugs (I can't find any at MSDN or TechNet) or do you have
an
> example/a pointer to info that you want to share?

> What I am trying to accomplish is finding an insertion point in a treeview
> for new data. I look at all nodes at a certain depth of the tree.

> Keld Laursen



Tue, 08 Feb 2005 21:29:11 GMT  
 TreeView: Can anybody tell me how to use the node references?

Quote:
> please see my reply to your previous post.

Sorry about that Mike. I must have missed that one. I had to search out the
message on some server somewhere.

Quote:
> One thing I forgot to mention:
> I was never able to reference a node in the treeview by
> it's Key (string), only by it's Index(Integer).

The biggest difference from what I have tried is the (1) instead of (0) base
of the nodes.
IIRC, I also tried to reference by key, but in this post you point out that
the key system is flawed :-(
I thought I should be able to reference something like:
tw1.Nodes(1).Child.Child.Text (to get to the third level's first nodes text,
but no cigar there.

It is the end of the working day here, so I'll try your example on Monday
morning.

Have a nice week-end.

Keld Laursen



Tue, 08 Feb 2005 21:39:47 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to tell what nodes are in the visible window in Treeview

2. object reference to treeview node

3. Q: Returning reference to Treeview node

4. Storing Object reference in node of TreeView

5. treeview node count not incrementing when adding new nodes

6. treeview - Move node, insert node

7. TreeView-Move Node Between Other Nodes?

8. Using a db for root node of a treeview

9. How to select/unselect Treeview node using keyboard?

10. How to select/unselect Treeview node using keyboard?

11. Using a db for root node of a treeview

12. How to select/unselect Treeview node using keyboard?

 

 
Powered by phpBB® Forum Software