473,748 Members | 2,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detect if User Clicks Parent or Child Node?

I want to be able to detect if a user has selected a parent or child node in
a treeview and depending on which is clicked act accordingly based on the
tag. I can get the values but don't know if they are child or parent
values. Thanks
Nov 21 '05 #1
5 4008
"B-Dog" <bd***@hotmail. com> schrieb
I want to be able to detect if a user has selected a parent or child
node in a treeview and depending on which is clicked act accordingly
based on the tag. I can get the values but don't know if they are
child or parent values. Thanks


Each child can also be a parent. Each parent can also be a child.
Armin
Nov 21 '05 #2
I guess if you have three nodes, but with two there should only be parent
and child right? Well maybe I'm going about it wrong. I want to see if
they click the username(do something) or if they click the child node below
it (do something) Any suggestions?

"Armin Zingler" <az*******@free net.de> wrote in message
news:#z******** *****@TK2MSFTNG P14.phx.gbl...
"B-Dog" <bd***@hotmail. com> schrieb
I want to be able to detect if a user has selected a parent or child
node in a treeview and depending on which is clicked act accordingly
based on the tag. I can get the values but don't know if they are
child or parent values. Thanks


Each child can also be a parent. Each parent can also be a child.
Armin

Nov 21 '05 #3
"B-Dog" <bd***@hotmail. com> schrieb
I want to be able to detect if a user has selected a parent or
child node in a treeview and depending on which is clicked act
accordingly based on the tag. I can get the values but don't
know if they are child or parent values. Thanks


Each child can also be a parent. Each parent can also be a child.


I guess if you have three nodes, but with two there should only be
parent and child right? Well maybe I'm going about it wrong. I
want to see if they click the username(do something) or if they
click the child node below it (do something) Any suggestions?

I didn't know there is only a total of two nodes.

Each node has a parent property. If it is Nothing, the node is the parent.
Armin
Nov 21 '05 #4
Thanks will look at that...

"Armin Zingler" <az*******@free net.de> wrote in message
news:eL******** ******@TK2MSFTN GP09.phx.gbl...
"B-Dog" <bd***@hotmail. com> schrieb
> I want to be able to detect if a user has selected a parent or
> child node in a treeview and depending on which is clicked act
> accordingly based on the tag. I can get the values but don't
> know if they are child or parent values. Thanks

Each child can also be a parent. Each parent can also be a child.


I guess if you have three nodes, but with two there should only be
parent and child right? Well maybe I'm going about it wrong. I
want to see if they click the username(do something) or if they
click the child node below it (do something) Any suggestions?

I didn't know there is only a total of two nodes.

Each node has a parent property. If it is Nothing, the node is the parent.
Armin

Nov 21 '05 #5
Or try this. On the parent node, set Tag="parent". On the child
node(s), set Tag="child". (name the tags anything you want). Now for
each tag, you check what Tag is equal to and you will know whether it
is a parent or a child. I think this should work...

John

Nov 21 '05 #6

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

Similar topics

2
3320
by: Nutshell | last post by:
Hi, I would like to add an attribute to the child node if it is the only child node. The problem is I am not getting the correct count of child nodes with this template: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes" encoding="UTF-8" />
9
2084
by: jon wayne | last post by:
OK! I had this nagging doubt Consider (without worrying abt access specifiers) class Kid : public Parent{...}; Parent::someFunc() { Kid k; }
2
5310
by: dannielum | last post by:
Hi all, I am trying to write a Binary Search Tree that each of its node will have 3 node pointers: left, right and parent. I need a parent pointer for some the purpose of my project. Without the pointer to the parent node, the program will be inefficient and slow. It works fine at first. However, when I started to build the remove function, it destroys the tree when I delete a node. I already changed the parent pointer whenever I delete a...
1
1960
by: clintonG | last post by:
How do I get a TreeNode.Parent property when using the 2.0 TreeView control? When the data source is an XML file there may be redundant names in the tree. For example, when a child node with the value of 'name' is selected I don't have a clue how to get the name of its parent which may be 'person' or 'school.' <%= Clinton Gallagher
4
2922
by: patrizio.trinchini | last post by:
Hi all, I'm new to XSLT and maybe my problem have a very trivial answer, but I need an expert that point me in the right direction. What I would obtain is to remove all the elements that have a child element with an attribute set at a given value; maybe an example is more self-explaining... Given the following input XML document:
3
5458
by: Irocivan | last post by:
Hello, I download a nice collapse menu for free distribution from the internet. It works very well except that none of the parents nodes are clickable (i.e. when clicking on the parent node, the link does not work). For example, if the below content is included in the html page, I would like that page www.fruit.com can be loaded whenever I click it. However the javascript does not allow the page to be loaded, It would only work for the child...
6
1728
by: Proogeren | last post by:
I was wondering if there is a way to detect if the user clicks on a node in a treeview. I know of the onnodeclickchange event but this will not fire if you click on the same node twice (only fire the first time you click as the second time it will not be a node click changed event). Everytime the user clicks on the node I want to redirect him to another page. does anyone know how I can acheive this? Is there any way to detect if a node has...
6
2515
by: SQACSharp | last post by:
I'm using the EnumChildWindows API with an EnumChildWndProc callback to populate the treeview. The output will be something similar to spy+ + How can I specify the parent when adding a new node ?? When adding a new node is there any way to get an handle or something else to be able add the childs to the correct parent ? Thanks!
0
2582
by: Guzeppi | last post by:
Hi, i'm using linq to load an xml structure into my classes. the xml consists of the same node nested for multiple levels e.g. <node id="node_id01" name="node 01"> <node id="node_id0101" name="node 01 01"> <node id="node_id010101" name="node 01 01 01"> <node id="node_id01010101" name="node 01 01 01 01"> <node id="node_id0101010101" name="node 01 01 01 01 01">
0
8996
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9386
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.