Results 1 to 1 of 1

Thread: [RESOLVED] - Treeview - Not Populating when Node.Depth = 2

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2003
    Location
    Georgia
    Posts
    32

    Resolved [RESOLVED] - Treeview - Not Populating when Node.Depth = 2

    I have node.depth 0 & 1 populating correctly but 2 will not populate. For some reason when I step through the code it thinks it is still at depth 1. Any help would be appreciated.

    HTML Code:
    <asp:TreeView ID="tvVSS" OnTreeNodePopulate="PopulateNode" SkinID="MSDN" Width="250" ExpandDepth="1" runat="server" MaxDataBindDepth="3" >
        <Nodes>
            <asp:TreeNode Text = "SourceSafe Directory" SelectAction="Expand" PopulateOnDemand="True" Value="SourceSafe Directory" />
        </Nodes>
    </asp:TreeView>
    VB Code:
    1. Sub GetClient(ByVal node As TreeNode)
    2.  
    3.         Dim thisItem As SourceSafeTypeLib.IVSSItem
    4.         vsDB = New SourceSafeTypeLib.VSSDatabase
    5.         vsDB.Open(strVSSDB, strVSSUser, strVSSPW)
    6.         strCurrentPrj = "$/client_import/"
    7.         vsDB.CurrentProject() = strCurrentPrj
    8.  
    9.         Try
    10.             For Each thisItem In vsDB.VSSItem(vsDB.CurrentProject).Items(False)
    11.                 If thisItem.Type = VSSITEM_PROJECT Then
    12.                     Dim newNode As TreeNode = New TreeNode(thisItem.Name)
    13.                     newNode.SelectAction = TreeNodeSelectAction.Expand
    14.                     newNode.PopulateOnDemand = True
    15.                     node.ChildNodes.Add(newNode)
    16.                 End If
    17.             Next
    18.         Catch ex As Exception
    19.             'Put error handling here
    20.  
    21.         End Try
    22.  
    23.     End Sub
    24.  
    25.     Sub GetVersion(ByVal node As TreeNode)
    26.  
    27.         Dim thisItem As SourceSafeTypeLib.IVSSItem
    28.         vsDB = New SourceSafeTypeLib.VSSDatabase
    29.         vsDB.Open(strVSSDB, strVSSUser, strVSSPW)
    30.         Client = node.Value
    31.         strCurrentPrj = "$/client_import/" & Client & "/PROCESSES/"
    32.         vsDB.CurrentProject() = strCurrentPrj
    33.  
    34.         Try
    35.             For Each thisItem In vsDB.VSSItem(vsDB.CurrentProject).Items(False)
    36.                 If thisItem.Type = VSSITEM_PROJECT Then
    37.                     Dim newNode As TreeNode = New TreeNode(thisItem.Name)
    38.                     node.ChildNodes.Add(newNode)
    39.                 End If
    40.             Next
    41.         Catch ex As Exception
    42.  
    43.         End Try
    44.  
    45.     End Sub
    46.  
    47.     Sub GetProcess(ByVal node As TreeNode)
    48.  
    49.         Dim thisItem As SourceSafeTypeLib.IVSSItem
    50.         vsDB = New SourceSafeTypeLib.VSSDatabase
    51.         vsDB.Open(strVSSDB, strVSSUser, strVSSPW)
    52.         Version = node.Value
    53.         strCurrentPrj = "$/client_import/" & Client & "/PROCESSES/" & Version
    54.         vsDB.CurrentProject() = strCurrentPrj
    55.  
    56.         Try
    57.             For Each thisItem In vsDB.VSSItem(vsDB.CurrentProject).Items(False)
    58.                 If thisItem.Type = VSSITEM_PROJECT Then
    59.                     Dim newNode As TreeNode = New TreeNode(thisItem.Name)
    60.                     node.ChildNodes.Add(newNode)
    61.                 End If
    62.             Next
    63.         Catch ex As Exception
    64.  
    65.         End Try
    66.  
    67.     End Sub
    68.  
    69.     Sub PopulateNode(ByVal source As Object, ByVal e As TreeNodeEventArgs)
    70.  
    71.         Select Case e.Node.Depth
    72.             Case 0
    73.                 GetClient(e.Node)
    74.             Case 1
    75.                 GetVersion(e.Node)
    76.             Case 2
    77.                 GetProcess(e.Node)
    78.         End Select
    79.  
    80.     End Sub
    Last edited by odamsr; Jun 29th, 2006 at 09:00 PM. Reason: Resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width