473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Treeview Selected Item

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.
Nov 16 '05 #1
1 7698
Oops. Found it. I was using the "Click" event of the treeview
control. I just discovered there is an "AfterSelect" method.

I love Google. :)

On Fri, 12 Nov 2004 10:31:50 +0000, Marc Jennings
<Ma**********@community.nospam> wrote:
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.


Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview....
7
by: amruta | last post by:
the code below dows not let me get the parent child view... all the nodes are show in one line only... also i need them to be collasped ... Thanks ..
4
by: Andrew Robinson | last post by:
I am using a TreeView to perform navigation and have a few nodes that need to generate a popup menu. For this, I use the SelectedNodeChanged event and then add the relevant "window.open" script to...
2
by: Tymbow | last post by:
I'm building a web application that is analogous to the Windows XP file explorer in function. The left column contains a TreeView, and the right column a DataGrid populated by selecting TreeView...
6
by: cyriel1920 | last post by:
Hi, I use the selectednodestyle with a white background so the user can see which item was chosen in the treeview navigation. The nodes have a navigateURL with a target to another frame....
2
by: Manikandan | last post by:
Hi, I'm using .NET1.1. I have a windows form with two controls 1.Treeview 2.Checkbox I added the items into tree view, the user selects the item in treeview. When i click the item in...
4
by: Xenomorph | last post by:
I have a program where you click an item on the TreeView on the left, and then work with whatever pops up on the right. There are many entries on the TreeView, and when you click something on the...
0
by: bsturg21 | last post by:
Hello, I have an app that has a custom treeview which inherits the base treeview class and I am having a problem with the way the treeview is being redrawn. Each node in the treeview represents a...
0
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.