Rank: Member Groups: Member
Joined: 11/9/2007 Posts: 15
|
Add 15 nodes at the same time and within them add a subset of 1000 nodes each.
I have a treeview where recover a little more than 14000 records of a database but to expand the node where it takes an eternity add what I want my node is then divided into 15 subnodes containing my records.
'this is my code to add nodes-- Dim dataViewHijos As Data.DataView dataViewHijos = New Data.DataView(ds.Tables(0)) TreeView1.DataSource = ds If TreeView1.Nodes.Item(1).SubGroup.Nodes.Item(0).Text = "Ductos" Then For Each dataRowCurrent As Data.DataRowView In dataViewHijos Dim nuevoNodo As New TreeNode nuevoNodo.Text = dataRowCurrent("Ducto").ToString() TreeView1.Nodes.Item(1).SubGroup.Nodes.Item(0).SubGroup.Nodes.Add(nuevoNodo.Text) TreeView1.Nodes.Item(1).SubGroup.Nodes.Item(0).Expanded = True Next dataRowCurrent End If
Thanks!!!!
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi Rafo,
You missed the point of my previous post. The issue is not how many nodes you are adding at the same time, the issue is how many records you have under one parent.
Let's see an example. Let's say you have 1000 songs on your computer. Instead of putting them all inside one single "c:\Music" directory, you might want to break them into many sub directories such as first by band, then by album. This way you might have 10 sub directories under "c:\Music", each for a different band. Inside each band's folder, you can then have folders for different albums. And eventually you will only have about 10 songs in each folder.
In order to correctly use the TreeView, first you will need to reorganize your data structure as you would do with your 1000 songs.
Thanks
|