How to add dummy nodes to Treeview for testing

Figure out how many (let’s say 100 for this example) nodes you’d like to add.
Then, add code similarly, in your Page_Load event:

Dim x as integer    For x=1 to 100          Dim nd as Treenode=new Treenode            nd.Text="Node" & x          nd.value="Node" & x          Treeview1.Nodes.add(nd)     Next

That’s it – - if you want to add subnodes, you can add a recursive routine to add subnodes for each of the above nodes added.                       

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>