If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Treeview issue

Ok guys here is what I am running into...

I have a VB.net application with a treeview I want to fill at runtime, the problem, due to the size of the records I can't fill it all at once or it will take FOREVER to run, so wat I want to do is wait to fill in the child nodes till after the parent node is selected and a new parameter is passed in (for example expand node1 and then pass in the key value through to another query and these results are the value of the children). My partner got it working in ASP but it doesn't seem to work in VB.net client. Here is the ASP code

Image indexes was from my own code as I have images in my windows application, can ignore them.

I created a PopulateNode function for my Windows application. I am using Windows so the protected web method may do the trick and won't need to use before expand. However for each row you will have to add a blank node, the code I used was as follows:

With dtCategories
For Each drCategory In .Rows
ndeCategory = New TreeNode
ndeCategory.Tag = drCategory("CategoryID")
ndeCategory.Text = drCategory("Name")
' Where no parent id add root category
If intParentid = 0 Then
tvwCategorySelector.Nodes.Add(ndeCategory)
Else
' or add embedded category
tvwCategorySelector.SelectedNode.Nodes.Add(ndeCategory)
End If
' Add embedded category where children exist
If drCategory("Children") > 0 Then
ndeCategory.Nodes.Add("")
End If
Next
End With