Copies all the items from the System.Web.UI.WebControls.TreeNodeCollection object to a compatible one-dimensional array of System.Web.UI.WebControls.TreeNode objects, starting at the specified index in the target array.
- nodeArray
- A zero-based array of System.Web.UI.WebControls.TreeNode objects that receives the copied items from the System.Web.UI.WebControls.TreeNodeCollection.
- index
- The position in the target array at which to start receiving the copied content.
Use the TreeNodeCollection.CopyTo(TreeNode[], int) method to copy the contents of the System.Web.UI.WebControls.TreeNodeCollection into the specified zero-based Array object. Items are copied starting at the specified index of the target array. With the Array object, you can then use array syntax to access the items in the System.Web.UI.WebControls.TreeNodeCollection.
As an alternative, you can also use the TreeNodeCollection.GetEnumerator method to create an enumerator that can be used to access the items in the collection.