473,386 Members | 1,791 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.

Update Node in a tree view ctrl

Hello,
i use a tree view with a new class for 2 parameters:
Class myTreeNode
Inherits TreeNode
Public MenuText As String
Public MenuPage As Integer
Sub New(ByVal MenuTxt As String, ByVal MPage As Integer)
MyBase.New()
MenuText = MenuTxt
MenuPage = MPage
Me.Text = MenuText
End Sub
End Class
I add node by
TreeViewMenu.SelectedNode.Nodes.Add(New myTreeNode(TxtMenuEt2.Text,
TxtMenuEtPage2.Text))

i would like select an item of my treeview and update with TxtMenuEt2.Text
and TxtMenuEtPage2.Text data

i try
TreeViewMenu.SelectedNode = (New myTreeNode(TxtMenuEt2.Text, Page))
but it's not correct
can you help me please
THanks a lot
Nico

Nov 21 '05 #1
1 989
Hi,

Try something like this.

FindNodes(trvNorthWind.Nodes, "Robert King", "Ken Tucker")

Private Sub FindNodes(ByVal node As TreeNodeCollection, ByVal FindText As
String, _

ByVal NewText As String)

Dim tn As TreeNode

For Each tn In node

If tn.Text = FindText Then

tn.Text = NewText

End If

FindNodes(tn.Nodes, FindText, NewText)

Next

End Sub

Ken

------------

"Nicolas" <Ni*****@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.com...
Hello,
i use a tree view with a new class for 2 parameters:
Class myTreeNode
Inherits TreeNode
Public MenuText As String
Public MenuPage As Integer
Sub New(ByVal MenuTxt As String, ByVal MPage As Integer)
MyBase.New()
MenuText = MenuTxt
MenuPage = MPage
Me.Text = MenuText
End Sub
End Class
I add node by
TreeViewMenu.SelectedNode.Nodes.Add(New myTreeNode(TxtMenuEt2.Text,
TxtMenuEtPage2.Text))

i would like select an item of my treeview and update with TxtMenuEt2.Text
and TxtMenuEtPage2.Text data

i try
TreeViewMenu.SelectedNode = (New myTreeNode(TxtMenuEt2.Text, Page))
but it's not correct
can you help me please
THanks a lot
Nico


Nov 21 '05 #2

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

Similar topics

2
by: Piet | last post by:
Hi there, I have managed to write a small java program that display an xml file in a JTree. This was achieved by defining a suitable tree model. THe program works...somehow. The nodes (elements...
0
by: Saradhi | last post by:
Hi All, Here I am facing a performance problem with the TreeView Node renaming. I am displaying a hierarchy Data in a treeview in my Windows C# Application. My tree view represents an...
3
by: Saradhi | last post by:
Hi All, Here I am facing a performance problem with the TreeView Node renaming. I am displaying a hierarchy Data in a treeview in my Windows C# Application. My tree view represents an...
3
by: Brian Henry | last post by:
If i already have a tree view created, and want to add another new node to it, how would i do so? Is there a way to throught tags or anything? like i have this RootNode | +-- Child 1 +--...
1
by: Christian Rühl | last post by:
hey! what i wanna do sounds very simple at first, but it turned out to be a real bone crusher... i want to check if a treeView node is checked and if a correspondent node in my xml config file...
22
by: pbd22 | last post by:
hi. I am having probelms with an update statement. every time i run it, "every" row updates, not just the one(s) intended. so, here is what i have. i have tried this with both AND and OR and...
1
by: BeginingOfLife | last post by:
i am using a java script to create a tree view in my html page. i got that script from this link : http://destroydrop.com/javascripts/tree/ given script is static script creations for tree...
1
by: happy.john1234 | last post by:
Hi, i am a new bie in programming.I am currently doing a project that displays certain hierarchial set of data in tree view.I currently implemented this tree view to be displayed in xml file ...
3
by: Michel Esber | last post by:
Hi all, DB2 V8 LUW FP 15 There is a table T (ID varchar (24), ABC timestamp). ID is PK. Our application needs to frequently update T with a new value for ABC. update T set ABC=? where ID...
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?
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
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.