how to collect the datas from the treeview using C#

Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2008
Posts: 56
Reputation: karthi_selva is an unknown quantity at this point 
Solved Threads: 0
karthi_selva karthi_selva is offline Offline
Junior Poster in Training

how to collect the datas from the treeview using C#

 
0
  #1
Nov 28th, 2008
Hi,

i created run time treeview. i do't know how to collects the datas from that treeview.

please send the syntax to me. i am searched in google but i m not get any relevant information.


Regards,

Karthikeyan S
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: how to collect the datas from the treeview using C#

 
0
  #2
Nov 28th, 2008
what "data" are you trying to get?
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,054
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 311
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Postaholic

Re: how to collect the datas from the treeview using C#

 
0
  #3
Nov 28th, 2008
You can get the text of the node with the following, but I am not shure if it is that what you want:
  1. private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  2. {
  3. TreeNode selectedNode = e.Node;
  4. if (selectedNode.Nodes.Count == 0) //we have no children
  5. {
  6. Console.WriteLine(selectedNode.Text);
  7. }
  8. }
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 56
Reputation: karthi_selva is an unknown quantity at this point 
Solved Threads: 0
karthi_selva karthi_selva is offline Offline
Junior Poster in Training

Re: how to collect the datas from the treeview using C#

 
0
  #4
Nov 29th, 2008
hi the above code is only for the selected node

i need to read all root node and their child node in the tree.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: how to collect the datas from the treeview using C#

 
0
  #5
Nov 29th, 2008
Then step through the nodes of the treeview, but its only going to show the text you put in.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C# Forum


Views: 442 | Replies: 4
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC