sharing knowledge……

Bind data ke dalam Tree View

Private Sub BindCOATree(ByVal sParentCOACode As String, ByRef inTreeNode As TreeNode)


Dim parentrow As DataRow
Dim ParentTable As DataTable
ParentTable = New DataTable()
Dim id As SqlString = New SqlString()
Dim ConnectCoaType As DataAccess.DataAccess.clsTCOA
ConnectCoaType = New DataAccess.DataAccess.clsTCOA()
ConnectCoaType.sParentCOACode = id.op_Implicit(sParentCOACode)
ParentTable = ConnectCoaType.GetCOAByTree()

For Each parentrow In ParentTable.Rows
Dim parentnode As TreeNode
Dim treeComplet As TreeNode

‘ini text yang muncul d caption tree viewnya
Dim strLabel As String = “[” & parentrow.Item(0) & “] ” & parentrow.Item(1) ‘& ” (” & parentrow.Item(4) & “)”

parentnode = New TreeNode(strLabel)
parentnode.Tag = parentrow.Item(0)

BindCOATree(parentrow.Item(0), parentnode)

Next parentrow

Catch ex As Exception
Dim pesan As String = “Error waktu query Category!”
Dim lokasi As String = “class: u_fm_Maintenance_COA, method: GetCOAByTree()”
Dim tampil As ErrorMessage = New ErrorMessage(ex, pesan, lokasi)

End Try

End Sub

Tree view
Tree view

06/01/2009 - Posted by | Tree View

1 Comment »

  1. thank’s infonya.

    Comment by nuraeni | 13/09/2011 | Reply

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: