I have a treeview and I want certain nodes to be checked when the page loads and some not checked. I want to do this manually before I loop through a database so was wondering if there is any VB.NET code out there that would show me.
I was thinking something like this (using objects):
Dim Cat As List(Of Category)
Cat = Category.GetAllCategories
If Not Cat Is Nothing Then
Dim C As New RadTreeNode
Dim CatEach As Category
For Each CatEach In Cat
C.Text = CatEach.Category
C.Value = CStr(CatEach.catID)
If C.Text = "Antiques" Then
C.Checked = True
End If
RadTreeView1.Nodes.Add(C)
Next
End If
The treeview renders nicely but the "Antiques" checkbox remains unchecked. Any help here would be very much appreciated.
I was thinking something like this (using objects):
Dim Cat As List(Of Category)
Cat = Category.GetAllCategories
If Not Cat Is Nothing Then
Dim C As New RadTreeNode
Dim CatEach As Category
For Each CatEach In Cat
C.Text = CatEach.Category
C.Value = CStr(CatEach.catID)
If C.Text = "Antiques" Then
C.Checked = True
End If
RadTreeView1.Nodes.Add(C)
Next
End If
The treeview renders nicely but the "Antiques" checkbox remains unchecked. Any help here would be very much appreciated.