I am trying to bind childnodes with Radtreeview childnode. C

May 26 2017 1:28 AM
I am trying to bind childnodes with Radtreeview childnode. Code works fine on localhost and on development server but not on production.
It's creating "AMB Financial Groups Lists" childnode but not populating it with its child nodes.Web server files and database tables are identical on my localhost and on production server
Private Sub PopulateProductNodes(ByRef node As RadTreeNode)
Dim ds As New DataSet
Dim cNode As RadTreeNode
'Try
For x = 0 To node.Nodes.Count - 1
If node.Nodes(x).Nodes.Count > 0 Then
PopulateProductNodes(node.Nodes(x))
Else
'leaf
ds = clsRef.oclsCompany.GetCompStandardList(0, node.Nodes(x).Value)
If ds.Tables.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
cNode = New RadTreeNode
cNode.Value = ds.Tables(0).Rows(i)(2)
cNode.Text = ds.Tables(0).Rows(i)(1)
node.Nodes(x).Nodes.Add(cNode)
If Trim(cNode.Text.ToLower) = "ambChild" Then
Dim dscustcomp As New DataSet
dscustcomp = clsRef.oclsCompany.GetCompStandardListItems(0, cNode.Value, sProdCode)
Dim AMBNode = New RadTreeNode(""ambChild" ", "ambChildGroupsNode")
AMBNode.Selected = TreeNodeSelectAction.Expand
Dim AMBLeafNode = New RadTreeNode
**For Each dr In dscustcomp.Tables(0).Rows
AMBLeafNode = New RadTreeNode(dr.Item("Display"), dr.Item("ID"))
AMBNode.Nodes.Add(AMBLeafNode)
Next**
node.Nodes(x).Nodes.Add(AMBNode)
End If
If node.Nodes(x).Selected <> TreeNodeSelectAction.Expand Then
node.Nodes(x).Selected = TreeNodeSelectAction.Expand
End If
Next
End If
End If
Next
'Finally
ds.Dispose()
ds = Nothing
cNode = Nothing
'End Try
End Sub

Answers (5)