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

How To Find No. Of Parent Nodes of a Selected Node in a TreeView

Hi ,

I m using a treeview , in which ,based upon the level of the node i need to show the context menu.But I m not able to find the level of the node. i.e the no. Of Parent node. Pls help me on this.
Sep 11 '06 #1
1 1875
Banfa
9,065 Expert Mod 8TB
I'm not a .net expert but in .net Version 2 I think you can use

TreeView::SelectedNode to get a TreeNode class for the currently selected node

and then

TreeNode::Depth to get the depth of the current node in the tree
Sep 11 '06 #2

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

Similar topics

1
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...
4
by: JoKur | last post by:
I'm currently using a context menu to allow the user to add, rename and delete nodes in a treeview control. When a node is added we give it a bogus name ("NewNode") and invoke the add method. We...
0
by: usamaalam | last post by:
Hello everybody, I have a treeview control in my application and a hierarchy of sub-nodes. Application works on rights. If user doesnt have rights to see a particular screen, the treeview node...
7
by: amruta | last post by:
the code below dows not let me get the parent child view... all the nodes are show in one line only... also i need them to be collasped ... Thanks ..
1
by: Tom | last post by:
Hey, I have a treeview control which i am reading and writing slots to (Its a player manager for Delta Force Black Hawk Down). At the moment, every 100ms it reads through the games memory to...
1
by: HIFIZombie | last post by:
or be able to tell if the selected treenode is a parent node. I have looked at .gettype but how do i check it against something like treeview1.gettype = treeview.nodes.parentnode I use my...
6
by: dav61000 | last post by:
I have a parent form that uses a Treeview Control and I would like to pass the node selected to a child form where the user will add update or delete the record selected using a dataset. Is there a...
1
by: JR | last post by:
Hi, I need a routine/finction that finds a text, starting at the selected node, where a given text is in. say i have some nodes with 1 'sonday' and another with 'son' and I look for 'so' it...
4
by: jmDesktop | last post by:
I have searched everywhere and tried several things. I have a treeview with and want to be able to only select a parent node. For example: root //don't want to drag this -parent1 //yes, drag...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: 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
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
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,...

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.