TreeView in windows Application

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2008
Posts: 2
Reputation: aditya55 is an unknown quantity at this point 
Solved Threads: 0
aditya55 aditya55 is offline Offline
Newbie Poster

TreeView in windows Application

 
0
  #1
Jul 17th, 2008
Hello, I am working on project in which i want a treeview should have multiple child that ie
There is one parent and that parent should have multiple child and all this through coding using Primary key and Forieng key so any body who know ot plz send me the code
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 8
Reputation: vietnamese is an unknown quantity at this point 
Solved Threads: 0
vietnamese vietnamese is offline Offline
Newbie Poster

Re: TreeView in windows Application

 
0
  #2
Jul 19th, 2008
Hello
I hope it can help you a bit
  1. TreeNode treeNode = new TreeNode();
  2. treeNode = treeView.Nodes.Add("Parent");
  3.  
  4. //Child
  5. for (int i = 0 ; i<10; i++)
  6. {
  7. TreeNode childNode = New TreeNode();
  8. childNode.Text = "Chile" + i.ToString;
  9.  
  10. //picture
  11. //childNode.ImageKey = i;
  12.  
  13. //Picture when selected
  14. //childNode.SelectedImageKey = "C" & i;
  15.  
  16. treeNode.Nodes.Add(childNode);
  17.  
  18. //Child's Child Node
  19. for (int j = 1; j <5; j++)
  20. {
  21. TreeNode childChildNode = New TreeNode();
  22. childChildNode.Text = "childChildNode" + j.ToSrting();
  23. childNode.Nodes.Add(childChildNode);
  24. }
  25. }
Last edited by Tekmaven; Jul 19th, 2008 at 3:41 am. Reason: Code tags
How to stop worring and start living
Reply With Quote Quick reply to this message  
Reply

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


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC