471,317 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

Tree View Node Selection

Once a treeview node is selected how can I programmatically unselect it so
that it might be selected again following the first selection if the user
desires?
The after selection event only fires when the selection changes.
Jan 23 '06 #1
2 13051
Can't you just do something like

myTreeView.SelectedNode= myTreeView.Nodes[0]

this would move the selectednode off the one just selected, allowing it to
be reselected?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jerry Langley" wrote:
Once a treeview node is selected how can I programmatically unselect it so
that it might be selected again following the first selection if the user
desires?
The after selection event only fires when the selection changes.

Jan 23 '06 #2
One can also simply set

this.treeView1.SelectedNode = null;

This will unselect any selected node.
--

Stoitcho Goutsev (100)

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:ED**********************************@microsof t.com...
Can't you just do something like

myTreeView.SelectedNode= myTreeView.Nodes[0]

this would move the selectednode off the one just selected, allowing it to
be reselected?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jerry Langley" wrote:
Once a treeview node is selected how can I programmatically unselect it
so
that it might be selected again following the first selection if the user
desires?
The after selection event only fires when the selection changes.

Jan 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Steve Johnson | last post: by
3 posts views Thread by imani_technology_spam | last post: by
reply views Thread by Tree menu using XML | last post: by
3 posts views Thread by Saradhi | last post: by
2 posts views Thread by dave.dolan | last post: by
3 posts views Thread by Adam Honek | last post: by
7 posts views Thread by Adam Honek | last post: by
reply views Thread by Rohit111111 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.