By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,939 Members | 1,541 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,939 IT Pros & Developers. It's quick & easy.

detect which node in a treeview is beeing clicked

P: 36
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 been clicked (and which one) other then the onnodeclick event?

I think this should be possible with java script but i dont know how... I only need to be able to redirect the user everytime he clicks on node

tnx
May 27 '07 #1
Share this Question
Share on Google+
6 Replies


prabunewindia
100+
P: 199
hai friend,
which database u r using to create tree?



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 been clicked (and which one) other then the onnodeclick event?

I think this should be possible with java script but i dont know how... I only need to be able to redirect the user everytime he clicks on node

tnx
May 28 '07 #2

P: 36
At the moment Im not using any db.. I just want to be able to detect click on a node.. Its fustrating.. If u know how to solve this by using JS please tell
May 28 '07 #3

P: 17
Hey Which application u r developing, is it a window application or a web application?
May 28 '07 #4

P: 36
it is a web application. so the treeview only has a onclicknodechanged event.. so if I click on the same node twice only the first click fires an event.. the second is ignored since i click on the same node...
In windows.forms this can be solved but how to do it in a web application i dont know :(
May 28 '07 #5

P: 17
Hi,
Each node in a treeview control has a 'Navigate URL' property. U can set URL to each node and user can navigate to that URL. Simple one.

Programatically doing so is very simple.

TreeNode Node = new TreeNode("Any Name");

Node.Value = "A Value";
Node.ImageUrl = "URL";
Tree.Nodes.Add(Node);
May 28 '07 #6

P: 36
aha how did i not think of that??
thanks alot my friend this helped me alot :)
May 28 '07 #7

Post your reply

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