Vertragsverwaltung-Klassenbibliothek  

clsParentelemente.LoadNode -Methode

Tree aufbauen

[Visual Basic]
Private Sub LoadNode( _ 
ByVal oDS As DataSet, _ 
ByRef oNode As TreeView
)

Parameter

oDS
Input-Dataset
oNode
Aktueller Node

Quellcode

[Visual Basic]
        Private Sub LoadNode(ByVal oDS As DataSet, ByRef oNode As TreeView) 
'Dim oTreeView As TreeView = New TreeView() 
Dim oDataRow As DataRow 
For Each oDataRow In oDS.Tables(0).Rows 
If Not oDataRow.IsNull("Parentid") Then 
If oDataRow.Item("Parentid") = 0 Then 
'If oDataRow.IsNull("Parentid") Then 
Dim oNode1 As New TreeNode() 
oNode1.Text = oDataRow("Bezeichnung").ToString() 
oNode1.Tag = oDataRow("vertragselementnr").ToString 
If oDataRow.Item("aktiv") = 0 Then 
oNode1.NodeFont = Me.fnt_Strikeout 
oNode1.ImageIndex = 3 
oNode1.SelectedImageIndex = 3 
oNode1.StateImageIndex = 3 
Else 
oNode1.NodeFont = Me.fnt_normal 
oNode1.ImageIndex = 1 
oNode1.SelectedImageIndex = 1 
oNode1.StateImageIndex = 1 
End If 
oNode.Nodes.Add(oNode1) 
RecursivelyLoadNode(oDataRow, oNode1) 
End If 
End If 
Next oDataRow 
oDS.Dispose() 
oDS = Nothing 
End Sub

Forderungen

Plattformen: Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

Siehe auch

clsParentelemente