G
Guest
Hi to all
I have tree web controls with 3 level nodes
when i create 2 level nodes thers is no problem but when i add the thired
level
this erreur occurs :
Exception Details: System.ArgumentOutOfRangeException: Specified argument
was out of the range of valid values. Parameter name: Index was out of range.
Must be non-negative and less than the size of the collection.
My code :While i < ds.Tables(0).Rows.Count
parentNode = New TreeNode()
parentNode.Text = ds.Tables(0).Rows(i).Item(0)
tree.Nodes.Add(parentNode)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
GAdaraID = ds.Tables(0).Rows(i).Item(1)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
j = 0
While j < ds.Tables(1).Rows.Count
AdaraID = ds.Tables(1).Rows(j).Item(1)
If AdaraID = GAdaraID Then
childNode = New TreeNode()
childNode.Text = ds.Tables(1).Rows(j).Item(0)
tree.Nodes(i).Nodes.Add(childNode)
End If
KAID = ds.Tables(1).Rows(j).Item(2)
h = 0
While h < ds.Tables(2).Rows.Count
KID = ds.Tables(2).Rows(h).Item(1)
If KID = KAID Then
CChildNode = New TreeNode()
CChildNode.Text = ds.Tables(2).Rows(h).Item(0)
tree.Nodes(i).Nodes(j).Nodes.Add(CChildNode)
End If
h += 1
End While 'end h
j += 1
End While ''end j
i += 1
End While 'end i
////////////////////////////////////
any ideas ??
thanks
I have tree web controls with 3 level nodes
when i create 2 level nodes thers is no problem but when i add the thired
level
this erreur occurs :
Exception Details: System.ArgumentOutOfRangeException: Specified argument
was out of the range of valid values. Parameter name: Index was out of range.
Must be non-negative and less than the size of the collection.
My code :While i < ds.Tables(0).Rows.Count
parentNode = New TreeNode()
parentNode.Text = ds.Tables(0).Rows(i).Item(0)
tree.Nodes.Add(parentNode)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
GAdaraID = ds.Tables(0).Rows(i).Item(1)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
j = 0
While j < ds.Tables(1).Rows.Count
AdaraID = ds.Tables(1).Rows(j).Item(1)
If AdaraID = GAdaraID Then
childNode = New TreeNode()
childNode.Text = ds.Tables(1).Rows(j).Item(0)
tree.Nodes(i).Nodes.Add(childNode)
End If
KAID = ds.Tables(1).Rows(j).Item(2)
h = 0
While h < ds.Tables(2).Rows.Count
KID = ds.Tables(2).Rows(h).Item(1)
If KID = KAID Then
CChildNode = New TreeNode()
CChildNode.Text = ds.Tables(2).Rows(h).Item(0)
tree.Nodes(i).Nodes(j).Nodes.Add(CChildNode)
End If
h += 1
End While 'end h
j += 1
End While ''end j
i += 1
End While 'end i
////////////////////////////////////
any ideas ??
thanks