473,386 Members | 1,753 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,386 software developers and data experts.

get the value of the selected node in a treeview

Sam
hi
i'm trying to get the value of the selected node in my treeview.
my code is:

txtTable1.Text = tvRelations.SelectedNode.Parent.ToString

but it adds the string 'TreeNode: ' to the value of the node (_56Zones)
as such:

TreeNode: _56Zones

Why ? and how can I get rid of that w/o having to use string functions
?

thx

Nov 21 '05 #1
1 13523
"Sam" <sa**************@voila.fr> schrieb:
i'm trying to get the value of the selected node in my treeview.
my code is:

txtTable1.Text = tvRelations.SelectedNode.Parent.ToString

but it adds the string 'TreeNode: ' to the value of the node (_56Zones)
as such:

TreeNode: _56Zones


Use 'SelectedNode.Parent.Text' instead. If you are storing a value in the
node's 'Tag' property, use 'SelectedNode.Parent.Tag.ToString()' to convert
the value to a string.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

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

Similar topics

1
by: hzgt9b | last post by:
I want to determine the back color that treeview node takes on when selected... its some blue value but I haven't been able to determine what it is... The reason that I ask is that when the...
2
by: ONIL | last post by:
I have a treeview in my ASP.NET vb.net application.when someone selects a node on the treeview How do I set the node name myNodeName = TreeView1.Nodes(TreeView1.SelectedNodeIndex).Text The...
1
by: jesper_lofgren | last post by:
Hello, Iam using Treeview control in asp.net 2.0. But have a problem. I use NavigateUrl BUT then viewstate is lost when clicked on a link i the menu. And the selected node is lost. Then i...
1
by: Wes | last post by:
Hi there, Does anyone know how to get the selected node from a ASP.Net 2.0 TreeView in Javascript? I used to be able to get it in the old webcontrols one, but now the properties have changed...
0
Bob Ross
by: Bob Ross | last post by:
I am sure this is just me being stupid but I can't work out why there is no selected node when a treeview is disabled. I build the treeview in the code behind and disable it if a property is true...
1
by: Falcula | last post by:
Hello, I have a treeview control, when i select a item i navigate to url. But selected node is lost, it reset itself, loosing state. I post my code here. Thanks in advance. <script...
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: =?Utf-8?B?Rmx5Z3V5?= | last post by:
I have a TreeView with so many nodes that it requires scroll bars. When the user selects a node the screen is refreshed and the selected node is no longer visible. The TreeView is opened to the...
9
by: auntiejack56 | last post by:
Hi, I've got a treeview, and I want to display the node text property that I have a) clicked on or b) highlighted using the up or down arrows
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.