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

finding same indexed node in two treeviews

Raventara
Hi-a all,
I have two treeviews on a form (VB.NET) and one of them contains words, and the other commands. Each word has a command assigned to it. I chose to show this in a treeview as certain words have secondary words (like, "move" and "up"). I would love it if someone could explain to me how I could select the matching command from the hidden command treeview when someone selects a word in the other treeview.

Please help - these treeviews are driving me crazazy!

Thanks,

Rustle
Aug 31 '07 #1
3 1219
QVeen72
1,445 Expert 1GB
Hi,

Write this code in AfterSelect Event of the Main Tree.:

Expand|Select|Wrap|Line Numbers
  1. Me.TreeView2.SelectedNode = Me.TreeView1.SelectedNode
  2.  
Regards
Veena
Aug 31 '07 #2
Hi,

Write this code in AfterSelect Event of the Main Tree.:

Expand|Select|Wrap|Line Numbers
  1. Me.TreeView2.SelectedNode = Me.TreeView1.SelectedNode
  2.  
Regards
Veena
Hi, I did try that (first thing) but it did not seem to work... I will try it again...

Thanks
Sep 1 '07 #3
OK, that method just did nothing at all. Don't know why. I have ended up doing the following:

Expand|Select|Wrap|Line Numbers
  1.        Dim treenode As New TreeNode
  2.  
  3.         TreeNode = TREE_COMMANDS.Nodes(e.Node.Name)
  4.         If TreeNode Is Nothing Then
  5.             TreeNode = TREE_COMMANDS.Nodes("root").Nodes(e.Node.Name)
  6.             If TreeNode Is Nothing Then
  7.                 TreeNode = TREE_COMMANDS.Nodes("root").Nodes(e.Node.Parent.Name).Nodes(e.Node.Name)
  8.             End If
  9.         End If
  10.  
This of course only works for three levels, but I will not have any more than 3 levels so this is fine.

If anyone has any comments/improvements I'm well open to them

Cheers,

Rustle
Sep 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Deforgel | last post by:
Hello, Can anyone help me, I have a website using a SQL database that is called by ASP pages and I want the search engines to crawl through and index each of the items in the database. I've...
6
by: Jay Bienvenu | last post by:
I have the following Visual Basic .NET code in an ASP.NET project: ' ... Dim xdStructure As XmlDocument Dim xnStructureRoot As XmlNode xdStructure = New XmlDocument...
8
by: Russell Bearden | last post by:
Why are there no indexed properties in C#? For example: class blah { public Node Child { get {
4
by: Michael C# | last post by:
I have a quick question, and was just wondering if anyone knew a good resource, article(s) or sample source code. I want to be able to connect the nodes of two treeviews graphically via lines. I...
3
by: Woody Splawn | last post by:
I have been experimenting with Auto Slides and TreeViews and find them most usefull in Winforms. I know how to create a Treview and have it, for example, slide out from the left of my Winform but...
3
by: Kay | last post by:
Hi all, Can anyone tell me how do I set focus on a particular treenode at run time? If you need to know what I'm try to do please read on ... I have a treeview to represent a Country/Product...
7
by: leventyilmaz | last post by:
Hi, I have a very simple problem, but do not know an elegant way to accomplish this. ### # I have a list of names: names = # and another set of names that I want to insert into # the...
2
by: skrebbel | last post by:
Is there any faster/easier way of finding a child node of a certain DOMNode object than doing something like function getChildByTagname($curnode, $name) { foreach($curnode->childNodes as...
1
by: =?Utf-8?B?TWlrZSBDb2xsaW5z?= | last post by:
I have six treeviews on a page. Each one is nested inside an accordion pane. When I click on a node, it turns yellow. When I click on a node in another tree, I would like the previous selected node...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.