?
Solved

tree view in .net

Posted on 2009-07-01
1
Medium Priority
?
209 Views
Last Modified: 2013-11-07
Hi

I have created a tree view (see code section)

In which there is a root element called "$".

Now I want add nodes in this root column programatically. How can I do that in vb.net

<asp:TreeView ID = "tvMain" ExpandDepth = "0" PopulateNodesFromClient = "true" ShowLines = "true" 
                            ShowExpandCollapse = "true" runat = "server" CollapseImageUrl = "~/images/Folder.JPG" 
                            ExpandImageUrl = "~/images/FolderExpanded.JPG">
                            <Nodes>
                                 <asp:TreeNode Text="$" ImageUrl = "~/images/Folder.JPG">
                                     <asp:TreeNode Text="$" ImageUrl = "~/images/Folder.JPG">                                 
                                    </asp:TreeNode>
                                </asp:TreeNode>
                            </Nodes>
                        </asp:TreeView>

Open in new window

0
Comment
Question by:KaranGupta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 20

Accepted Solution

by:
ddayx10 earned 2000 total points
ID: 24752488
   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'just doing this so we dont add nodes every time posted back, completely optional
        'pick your poison from below
        If Not IsPostBack Then
            'Adds another child to the parent
            tvMain.Nodes(0).ChildNodes.Add(New TreeNode("$", "255", "~/images/Folder.JPG"))

            'Adds another node to the parent level
            tvMain.Nodes.Add(New TreeNode("$", "255", "~/images/Folder.JPG"))
        End If
    End Sub
0

Featured Post

RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question