Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to write the code for specific child node(more no of child node) in the corresponding tree view.Here is my Code:
C#
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
   UcStoreInfo nc = new UcStoreInfo();
   splitContainer1.Panel2.Controls.Add(nc);
}

if i select tree view root node, then only one after click event has come in the code behind.i could right only one child node. i have more than one child node. Now how to write the code for specific child node(more no of child node) in the corresponding tree view.

Thank you So much....
Posted
Updated 2-Sep-13 2:41am
v2

for specific child nodes you can set checked property for all of them true.

look at this:

http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.aftercheck.aspx[^]
 
Share this answer
 
Hi Krishnaramagovinda,

Common pattern is to use the "Tag" property of the node to store the corresponding object or other Information to identifiy the node(-type). In your "AfterSelect" handler than you can switch depending on the information (or simply the type) of the selected node.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900