By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,046 Members | 2,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,046 IT Pros & Developers. It's quick & easy.

<asp:TreeView> ShowExpandCollapse & individual nodes' SelectAction

P: n/a

Adding nodes to a TreeView programatically...

1) Instantiate a TreeNode object and set its SelectAction to

2) Instantiate another TreeNode object and add it to the first TreeNode's
ChildNodes collection.

3) Add the first TreeNode to a TreeView's Nodes collection.

Now, when the user clicks the first TreeNode, it expands or contracts its
child nodes as expected, just as if the user had clicked the little square
box to the left of the node in question.

However, now your client tells you that he doesn't like the little square
boxes with the plus and minus signs, so you set the TreeView's
ShowExpandCollapse property to false. This, of course, removes the little
boxes but in doing so also removes the ability to expand those nodes with
child nodes - is this "normal" behaviour...?

If so, is the accepted workaround to set ShowExpandCollapse to true and to
set the TreeView's CollapseImageURL and ExpandImageURL to a transparent gif
with a size of 1px x 1px?

Any assistance gratefully received.

Feb 13 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.