S
skedward
Dear Sir,
I would like to check if the dynamically load nodes can still fire th
onselectednodechanged. Even if I changed to SelectExpand, it still doe
not work. My code
is as follows. Please help. Thanks.
best regards,
Edward
<ASP:TreeView id="TreeView1" OnTreeNodePopulate="TreeNodePopulate"
OnSelectedNodeChanged="TreeNodeSelectedNodeChanged" ExpandDepth="0
EnableViewState="false"
Visible=False ShowLines="true" runat="server"></ASP:TreeView>
Sub TreeNodeSelectedNodeChanged(ByVal sender As Object, ByVal
As EventArgs)
Value = TreeView1.SelectedNode.Value
Text = TreeView1.SelectedNode.Text
TreeView1.Visible = False
End Sub
Sub TreeNodePopulate(ByVal sender As Object, ByVal e A
TreeNodeEventArgs)
SetDV()
Dim nodes As DataView = GetChilds(DV, e.Node.Value)
' Populate Treeview.
For Each row As DataRowView In nodes
Dim newNode As New TreeNode()
newNode.Text = row("description").ToString()
newNode.Value = row("code").ToString()
'If Not IsNumeric(newNode.Value) Then
newNode.SelectAction
TreeNodeSelectAction.SelectExpand
newNode.PopulateOnDemand = True
'End If
e.Node.ChildNodes.Add(newNode)
'AddChild(DV, headNode)
Next
End Su
I would like to check if the dynamically load nodes can still fire th
onselectednodechanged. Even if I changed to SelectExpand, it still doe
not work. My code
is as follows. Please help. Thanks.
best regards,
Edward
<ASP:TreeView id="TreeView1" OnTreeNodePopulate="TreeNodePopulate"
OnSelectedNodeChanged="TreeNodeSelectedNodeChanged" ExpandDepth="0
EnableViewState="false"
Visible=False ShowLines="true" runat="server"></ASP:TreeView>
Sub TreeNodeSelectedNodeChanged(ByVal sender As Object, ByVal
As EventArgs)
Value = TreeView1.SelectedNode.Value
Text = TreeView1.SelectedNode.Text
TreeView1.Visible = False
End Sub
Sub TreeNodePopulate(ByVal sender As Object, ByVal e A
TreeNodeEventArgs)
SetDV()
Dim nodes As DataView = GetChilds(DV, e.Node.Value)
' Populate Treeview.
For Each row As DataRowView In nodes
Dim newNode As New TreeNode()
newNode.Text = row("description").ToString()
newNode.Value = row("code").ToString()
'If Not IsNumeric(newNode.Value) Then
newNode.SelectAction
TreeNodeSelectAction.SelectExpand
newNode.PopulateOnDemand = True
'End If
e.Node.ChildNodes.Add(newNode)
'AddChild(DV, headNode)
Next
End Su