SelectedNode is not correct in SelectedNodeChanged event


S

stacy

My asp.net Web application is written in VB, using VS 2005 with
Framework 2.0
I am having trouble with the SelectedNode element. The TreeView is
built programmatically and looks like this:

- PES
+SSI_Engineering
+Sensor:2
+Sensor:3
+Sensor:4
- SSI
+Sensor:1
+Sensor:2
+Sensor:3
+Sensor:4

The SelectedNodeChanged event contains code to grab the selected node:

Dim NodeSelected as TreeNode
NodeSelected = tvLightSystem.SelectedNode
where tvLightSystem is the TreeView control

No matter what node I select, the NodeSelected is set to the
SSI_Engineering node

I even tried writing code in the TreeNodeExpanded event similar to the
code above:

Protected Sub tvLightSystem_TreeNodeExpanded(ByVal sender As
Object, ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs) Handles
tvLightSystem.TreeNodeExpanded
NodeSelected = e.Node

End Sub
Again, e.Node is always 'pointing' at SSI_Engineering node no matter
which nodes plus sign I click to expand it.

Any ideas/hints would be appreciated

Thanks,
Stacy
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top