Treeview Selected Item

  • Thread starter Thread starter Marc Jennings
  • Start date Start date
M

Marc Jennings

Hi

There is probably a very simple answer to this, but I am not too
familiar with the treeView control...

I have a treeview control, populated from a database. I want to be
able to get the text property of the slected node when a user selects
one, but I don't know which methods to use.

If I try "Click" or "MouseDown", the returned string seems to be the
text of the previously selected item. (eg. "Item 17" is selected.
Click Item 4 and the returned value of treeNode1.SelectedNode.Text is
"Item17")

Can anyone point me at a resource to show me how to accurately get the
value of the *currently* selected item, or tell me which event I need
to trap to get the desired results.

(Of course, keyboard navigation is going to be an issue as well...)

TIA
Marc.
 
Oops. Found it. I was using the "Click" event of the treeview
control. I just discovered there is an "AfterSelect" method.

I love Google. :)
 
Back
Top