简体   繁体   中英

ASP.NET: Search inside treeview nodes

I have a treeview with some nodes

--Parent
  --Child-0
    --child-0.0
    --child-0.1
    --child-0.2
    --child-0.3
  --Child-1
  --Child-2

I am updating this treeview later on, how can u update/insert values into child-0.2 programmatically where i don't know how many child does Child-0 has?

Tried following code, but compiler doesn't like it

foreach (TreeNode n in Treeview1.Nodes[0].ChildNodes[0])
{
   //whats the syntax gonna be?
}
int childrenCount = Treeview1.Nodes[0].ChildNodes[0].ChildNodes.Count;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM