Friday 15 July 2011

Get checked treeview children to arraylist in c# -


Can someone please help me to take a tree view probe into an array list in C #

You can feed ArrayList with recurring, something like

  // add node children were checked in Arrielist private static zero AddCheckedNodes (tree node node, Arrayist list) {If (node ​​check) list. Add (node); For (int i = 0; i & lt; node.Nodes.Count; ++ i) AddCheckedNodes (node. Nodes [i], list); } // Add Tree Watch Check Nodes to Arrielist Public Static Wide Adecached Nodes (TreeView Move, Arlistist List) {If the Object. Reference Ecloss (empty, value) Repeat the new logic ("value"); If (Object References Eclipse (empty, list)) remove new logic ("list"); (Int i = 0; i & lt; value.Nodes.Count; ++ i) AddCheckedNodes (value.Nodes [i], list) for; } ... AddCheckedNodes (myTreeView, myArrayList);   

PS ArrayList is an obsolete category, the list will be better

No comments:

Post a Comment