Quick Start > Step 2: Creating Nodes in TreeView |
You can create nodes in TreeView either by using designer or through code in your application.
To create nodes in TreeView using designer, complete the following steps:
To create nodes in TreeView programmatically, complete the following steps:
' create new instances of node Dim node1 As New C1.Win.TreeView.C1TreeNode() Dim node2 As New C1.Win.TreeView.C1TreeNode() ' add parent node to the TreeView nodes collection C1TreeView1.Nodes.Add(node1) ' set the value of parent node node1.SetValue("Reports")
// create new instances of node C1.Win.TreeView.C1TreeNode node1 = new C1.Win.TreeView.C1TreeNode(); C1.Win.TreeView.C1TreeNode node2 = new C1.Win.TreeView.C1TreeNode(); // add parent node to the TreeView nodes collection c1TreeView1.Nodes.Add(node1); // set the value of parent node node1.SetValue("Reports");
' add child node to parent node node1.Nodes.Add(node2) 'set the value of child node node2.SetValue("May Sales")
// add child node to parent node node1.Nodes.Add(node2); //set the value of child node node2.SetValue("May Sales");