I have a .Net 2.0 treeview control on my ASP.net website.
the issue i have is that when a dynamically created treenode has been created and then is clicked..
the page is not posted back and the SelectedNodeChanged event does not get fired.
below i have shown my code that created the treenode
i have tried setting the TreeNode SelectAction as both select and selectAction neither of which makes any difference is firing the SelectedNodeChanged event.
the issue i have is that when a dynamically created treenode has been created and then is clicked..
the page is not posted back and the SelectedNodeChanged event does not get fired.
below i have shown my code that created the treenode
i have tried setting the TreeNode SelectAction as both select and selectAction neither of which makes any difference is firing the SelectedNodeChanged event.
VB.NET:
Private Sub DotvNavigation()
'build the tvNavigation
tvNavigation.Nodes.Clear()
Dim RootTreeNode As New TreeNode
RootTreeNode.Text = "System Name"
tvNavigation.Nodes.Add(RootTreeNode)
datareader = GetSqlData.GetNodes4Navigation
While datareader.Read
If datareader.HasRows = True Then
Dim iCount As Integer
Dim iParentMenuID As Integer = datareader(0)
Dim sMenuItemName As String = datareader(1)
Dim iMenuID As Integer = datareader(2)
Dim TreeNode As New TreeNode
TreeNode.Text = sMenuItemName
TreeNode.Value = iMenuID
'TreeNode.SelectAction = TreeNodeSelectAction.Select
TreeNode.SelectAction = TreeNodeSelectAction.SelectExpand
RootTreeNode.ChildNodes.Add(TreeNode)
End While
End Sub