[Mono-bugs] [Bug 601766] WinForms TreeView: foreach (TreeNode node in TreeNode.Nodes) loop behaves differently from .NET

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun May 2 23:54:47 EDT 2010



--- Comment #6 from Carlos Alberto Cortez <calberto.cortez at gmail.com> 2010-05-03 03:54:47 UTC ---
Actually you shouldn't use a TreeNodeCollection to just simple store a *plain*
list of nodes - use a List<TreeNode> list instead ;-) :

List<TreeNode> nodes = new List<TreeNode> ();
nodes.Add (new TreeNode ("A"));
nodes.Add (new TreeNode ("B"));

treeView1.Nodes.AddRange (nodes.ToArray ());

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list