Sir,
I am using tree view which is running perfectly, how I need to add more columns like isheadaccount, debit, credit as well. My codes are as follows, can you guide me changes to show more columns as said.
<div class="row" id="divTreeView" runat="server">
<table class="box-body table-responsive">
<tr>
<td style="width: 80px"></td>
<td style="width: 800px">
<asp:TreeView runat="server" ID="TreeView" ShowLines="true" LineImagesFolder="~/TreeLineImages"
Font-Size="9" OnTreeNodePopulate="TreeView_TreeNodePopulate">
</asp:TreeView>
</td>
</tr>
</table>
</div>
Private Sub LoadMainTreeAccounts()
Dim objCategory As New clsAccountMaster1
Dim ds As New DataSet
objCategory.CompanyId = Session("CompanyID")
If objCategory.LoadMainTreeAccounts(ds) = True Then
TreeView.Nodes.Clear()
If ds.Tables(0).Rows.Count = 0 Then
'lblMessage.Text = "No Data Found"
Else
For index = 0 To ds.Tables(0).Rows.Count - 1
Dim ParentTreeNode As New TreeNode
ParentTreeNode.Text = ds.Tables(0).Rows(index).Item("AccountTitle")
ParentTreeNode.Value = ds.Tables(0).Rows(index).Item("AccountID")
'ParentTreeNode.Value = ds.Tables(0).Rows(index).Item("Debit")
'ParentTreeNode.Value = ds.Tables(0).Rows(index).Item("Credit")
'Call Recursive Function
LoadChildTreeAccount(ParentTreeNode.Value, ParentTreeNode)
TreeView.Nodes.Add(ParentTreeNode)
Next
End If
End If
lblMessage.Text = ""
End Sub
Private Sub LoadChildTreeAccount(ByVal parentid As String, ByVal parentNode As TreeNode)
Dim objCategory As New clsAccountMaster1
Dim ds As New DataSet
objCategory.IsChildOF = parentid
objCategory.CompanyId = Session("CompanyID")
objCategory.LoadChildTreeAccounts(ds)
If ds.Tables(0).Rows.Count > 0 Then
For index = 0 To ds.Tables(0).Rows.Count - 1
Dim ChildTreeNode As New TreeNode
ChildTreeNode.Text = ds.Tables(0).Rows(index).Item("AccountTitle")
ChildTreeNode.Value = ds.Tables(0).Rows(index).Item("AccountID")
parentNode.ChildNodes.Add(ChildTreeNode)
If (CInt(ds.Tables(0).Rows(index).Item("ChildRows")) > 0) Then
LoadChildTreeAccount(ChildTreeNode.Value, ChildTreeNode)
End If
Next
End If
End Sub