0

I have tree view structure , and I need to implement function:

public void InsertNodeAtTheBeginning(TreeView tree, TreeNode node)
{
  tree.Nodes.Add_(node); // node should be added as tree.Nodes[0]
}

And every other nodes should be offset: tree.Nodes[1]...tree.Nodes[tree.Nodes.Count + 1]. All nodes in the tree have .Level property is equal to 0 ( so it's like a list)

1 Answer 1

3

Try TreeView.Nodes.Insert(0, ...)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.