rename treeview node children

A

Adam Sandler

Hello,

I have a treeview with a node where the children are read/populated
directly from a database. Some of the text which comes from this
database isn't always user friendly. I'd like to change the some of
the text.

But I don't see any members which represent a collection of items
underneath a given node. So, if I'm looking at something like this on
the screen:

--MapItems
|--roads
|--lakes
|--borders
|--rivers

TreeView1.Nodes.Count only returns 1... how can I get a hold of the
stuff belonging to a node so the text can be edited?

Thanks!
 
G

Guest

Hello,

I have a treeview with a node where the children are read/populated
directly from a database. Some of the text which comes from this
database isn't always user friendly. I'd like to change the some of
the text.

But I don't see any members which represent a collection of items
underneath a given node. So, if I'm looking at something like this on
the screen:

--MapItems
|--roads
|--lakes
|--borders
|--rivers

TreeView1.Nodes.Count only returns 1... how can I get a hold of the
stuff belonging to a node so the text can be edited?

Thanks!

Do you mean you need the text of node, like this:

TreeView1.Nodes(0).Text

?

To enumerate:

For i = 1 To TreeView1.Nodes.Count
....
Next
 
A

Adam Sandler

Do you mean you need the text of node, like this:

TreeView1.Nodes(0).Text

Not quite... I'm talking about the stuff underneath the node. Using
my example from the first post TreeView1.Nodes(0).Text is MapItems.
How do I get visibility of or rename the cascaded items (roads, lakes,
borders, rivers) which appear under the node (MapItems)?
 
M

Masudur

Not quite... I'm talking about the stuff underneath the node. Using
my example from the first post TreeView1.Nodes(0).Text is MapItems.
How do I get visibility of or rename the cascaded items (roads, lakes,
borders, rivers) which appear under the node (MapItems)?

Hi,

"TreeView1.Nodes[0].ChieldNodes" will do your job,,,,
before using it please check the Check the count of clieldnode
collection
TreeView1.Nodes[0].ChieldNodes.Count

Thanks
Masudur
www.kaz.com.bd
www.munnacs.blogspot.com
 
A

Adam Sandler

"TreeView1.Nodes[0].ChieldNodes" will do your job,,,,

There's no ChildNodes property showing up in intellisense. I can do
TreeView1.Nodes[0].Nodes -- which is useless, but there is no
ChildNodes visible.

Thanks!
 
G

Guest

Not quite... I'm talking about the stuff underneath the node. Using
my example from the first post TreeView1.Nodes(0).Text is MapItems.
How do I get visibility of or rename the cascaded items (roads, lakes,
borders, rivers) which appear under the node (MapItems)?

TreeView1.Nodes(0).Nodes(0).Text
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top