Hi
I've a tree view bound to a database, this is my code, and it works OK.
I've a tree view bound to a database, this is my code, and it works OK.
Dim Exp As New clsExpert
Dim dt As DataTable = Exp.GetChildByProvider(UserID, ProviderID)
If dt.Rows.Count > 0 Then
With Me.tvNav
.DataSource = dt
.DataFieldID =
"ID"
.DataFieldParentID ="ParentID"
.DataTextField = "Node"
.DataValueField = "ChildID"
.DataBind()
.ExpandAllNodes()
End With
Else
Me.lblNavStatus.Text = "No Children set up."
End If
This gives me a 2 level tree, with groups and children. How can I disable the top level nodes to stop users from clicking them and getting an error, as these first level nodes dont have any ID's associated with them.
Andy