Indentation of Treeview Control
I've set the Indentation property of my TreeView control to 0. However, when running the form, I found that the child nodes are still indented. :(
How can I further reduce this indentation, or even left-align the parent and the child nodes? :confused:
[266 byte] By [
Wayne Wong] at [2007-11-17 17:04:27]

# 1 Re: Indentation of Treeview Control
Seems as if you do not really need children...you can add a key to each node to know by code when needed if they are sons of a previous node, and use all non child node...
Of course this way you will loose the hide/show childrens (but you could code it..)
# 2 Re: Indentation of Treeview Control
Thx, Cimperiali. Ur idea is really nice! :D
But may I know how to hide/show and sort the children node?
Should I use the Node.Remove and Node.Add methods ('cuz Node.Visible is read-only)? If yes, would the code lead to serious time consumption or otehr side-effect if my list is very long? Moreover, since the sorting can only be done on the Node.Text property, how can I sort the "children" under a "parent" node? It seems that there are too many restrictions! :(
Can u give me more suggestion?
Thx a lot!
# 3 Re: Indentation of Treeview Control
To hide show nodes that are not children, you will have to load /unload a dummy child foreach "Father", and when click is detected on father, you should load/unload the children that are not children...
A lot of job, indeed...
May be you can achieve same result easier using another kind of control, like flexgrid control...