How to show + in TreeView

G

Guest

For efficiency reason, I do not want to populate all the nodes with children
of each in a treeview. I will just bring root nodes. How do I show a + sign
without adding children nodes?

The reason I want to do this is that I want to show a + sign so that users
get an indication that there are children under that. When a user expands a
node, it will turn that + to a - sign and show children if there are any.
 
H

Herfried K. Wagner [MVP]

Harshad said:
For efficiency reason, I do not want to populate all the nodes with
children
of each in a treeview. I will just bring root nodes. How do I show a +
sign
without adding children nodes?

The reason I want to do this is that I want to show a + sign so that users
get an indication that there are children under that. When a user expands
a
node, it will turn that + to a - sign and show children if there are any.

Add a dummy child node to each node that has children. When expanding the
node, replace the node with the actual children.
 
R

Roy Soltoff

The Infragistics UltraTreeview control has a Node property to do just that
without going through the mechanics of adding dummy nodes to each node that
could have children. In that control the proprty is:

Node.Override.ShowExpansionIndicator = ShowExpansionIndicator.Always
 

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

Top