Search KB Filter article types
TreeView CodeSample - Move a TreeNode from one node to another
Categories: Trees
Tags: Developers, 1. Beginner, Pre v6.3, v6.3, v6.4 and Later, 2. Intermediate, 3. Advanced
Revision: 1
Posted: 04/Oct/2009
Updated: 23/July/2010
Status: Publish
Types: Article

This article will have a few sections added to it soon, based on the following article type skeleton: CodeSample
Overview

This codesample will show you how you can programmatically move a TreeNode to another place in a TreeView

VB.NET Code
Private Sub MoveTreeNode(ByVal NodeToMove As TreeNode, ByVal NewParent As TreeNode)
    NodeToMove.Remove()
    NewParent.Nodes.Add(NodeToMove)
End Sub

C# Code
private void MoveTreeNode(TreeNode NodeToMove, TreeNode NewParent)
{
    NodeToMove.Remove();
    NewParent.Nodes.Add(NodeToMove);
}


About the author

Related Articles

Trees  
Title Update Author
Control of a combobox with a checked list and a tree.
Tags: Developers, Navigation, 2. Intermediate, 3. Advanced, Customization, Layouting, Navigation, Pre v6.3, v6.3, v6.4 and Later
06/Jan/2008    2008/01/06
This video demonstrates how to populate a TreeView control.
Tags: Developers, Data Binding, 1. Beginner, Data Binding, Pre v6.3, v6.3, v6.4 and Later, 2. Intermediate, 3. Advanced
01/Jan/2009    2009/01/01
This code snippet posted By NEC_VERSA demonstrates how to find a node in a tree view.
Tags: Developers, 1. Beginner, Pre v6.3, v6.3, v6.4 and Later, 2. Intermediate, 3. Advanced
12/Jan/2008    2008/01/12
This article contains code that demonstrates how to create a personalized look for TreeNodes that have the mouse hovering over them while dragging another element.
Tags: Developers, Drag & Drop, Events, C#, 2. Intermediate, 3. Advanced, Customization, v6.3, v6.4 and Later
06/Jan/2010    2010/01/06
Tags: Architects, Developers, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
04/Dec/2010    2010/12/04
Tags: Developers, Drag & Drop, 1. Beginner, Pre v6.3, v6.3, v6.4 and Later, 2. Intermediate, 3. Advanced
23/July/2010    2010/07/23
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS