i'm using visual basic, its my first time using treelist. Any suggestion how to set nodes at aspxtreelist?
i wanted set the nodes at treelist based from sql database.
schema :
SQL database
| id ---- partnerID |
| 1 ---- 2 |
| 2 ---- 3.2 |
| 3 ---- 4 |
Treelist
the treelist had value 2, 2.1, 2.2, 3, 3.1, 3.2 , 4, 5
| partnerID --- Command |
| 2 --- + |
| 2.1 --- + |
| 2.2 --- + |
| 3 --- + |
| 3.1 --- |
| 3.2 --- +|
| 4 --- |
| 5 --- |
'+' as nodes
When i load the page, i wanted the treelist had default selection node : 2, 2.1, 2.2, 3, 3.2
i don't know what property which must BE used.
i had solved my problem. here the answer i created :
Dim iterator As TreeListNodeIterator = tree1.CreateNodeIterator()
Dim node As TreeListNode
Dim foundRow As DataRow
Do While Not (_database Is Nothing)
node = iterator.GetNext()
If node Is Nothing Then
Exit Do
End If
foundRow = _database.Rows.Find(node.Key)
If Not (foundRow Is Nothing) Then
node.Selected = True
End If
Loop
_database is a datatable which i used to collect the value on my database.