Repopulate TreeView

Discussion in 'ASP .Net' started by JN, Jan 26, 2006.

  1. JN

    JN Guest

    Hi All,

    When an update is made to the gridview, I need to get rid of the current
    treeview and repopulate it with the changes.

    How do I get rid of the current treeview?

    Here is the code that populates the treeview when the page is first loaded.


    Sub PopulateNodesSimEx()
    Dim dst As DataSet = GetTreeViewData()

    Dim masterNode As New TreeNode("SimEx Inc.")

    TreeView1.Nodes.Add(masterNode)


    For Each childRow As DataRow In dst.Tables("tbDepartmentsSimEx").Rows

    Dim childNode As New TreeNode(childRow("SimExDepartment").ToString())

    masterNode.ChildNodes.Add(childNode)


    For Each childRow1 As DataRow In childRow.GetChildRows("ChildrenSimEx")

    Dim childNode1 As New TreeNode(childRow1("FullName").ToString())

    childNode.ChildNodes.Add(childNode1)

    Next

    Next


    Thanks.
    JN
    JN, Jan 26, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TaeHo Yoo
    Replies:
    4
    Views:
    728
  2. luna_s

    popup repopulate

    luna_s, Mar 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    331
    Teemu Keiski
    Mar 6, 2004
  3. =?Utf-8?B?Y2luZHk=?=
    Replies:
    0
    Views:
    501
    =?Utf-8?B?Y2luZHk=?=
    Sep 21, 2006
  4. TS

    explanation of when need to repopulate control

    TS, Aug 2, 2005, in forum: ASP .Net Building Controls
    Replies:
    28
    Views:
    524
    Steven Cheng[MSFT]
    Aug 24, 2005
  5. TS

    explanation of when need to repopulate control

    TS, Aug 2, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    114
    Steven Cheng[MSFT]
    Aug 3, 2005
Loading...

Share This Page