T
tanya foster
Hello,
I have populated a treeview in asp.net 2.0 from an xmldocument. The
treeview structure in the asp web page looks something like...
-orderdata
-order
-lines
-operations
-materials
-material
-partnumber="123"
-description="brass bolt"
-quantity="1"
-type="Job"
-units="grams"
-material
-partnumber="ABC"
-description="plywood"
-quantity="9"
-type="Job"
-units="pounds"
-material
-partnumber="999"
-description="metal frame"
-quantity="2"
-type="Job"
-units="whole"
....
the point is, there are multiple material children to a materials parent.
The treeview is name TreeViewForXml
My selectednodechanged callback begins like..
Protected Sub TreeViewForXml_SelectedNodeChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles TreeViewForXml.SelectedNodeChanged
Dim TextToEdit, StringToParse() As String
HideAllEditFields()
ListBoxForOrderInformation.Items.Add("Selected value=" &
TreeViewForXml.SelectedNode.Value & _
" text=" & TreeViewForXml.SelectedNode.Text)
......
The problem is, sometimes if I click on quantity="2" (or any other quantity
that is not in the first material child of materials), the selectednode(or
the message I get in my listbox) is quantity="1"(or always the quantity node
in the first material child of materials). In the above example, there are
3 material children of materials but there could be 20 material children or
more.
I am seeing this happen if I selected partnumber="999", the TreeviewForXml.
SelectedNode is partnumber="123"(the first child in the list of material
children).
What am I doing wrong to trap selectednode?
I know the TreeNodeCollection.IndexOf(treenode) method will return the first
occurrence of a node if it appears multiple times in the collection.
Is this also the rule with a treeview and selectednode?
thanks.
I have populated a treeview in asp.net 2.0 from an xmldocument. The
treeview structure in the asp web page looks something like...
-orderdata
-order
-lines
-operations
-materials
-material
-partnumber="123"
-description="brass bolt"
-quantity="1"
-type="Job"
-units="grams"
-material
-partnumber="ABC"
-description="plywood"
-quantity="9"
-type="Job"
-units="pounds"
-material
-partnumber="999"
-description="metal frame"
-quantity="2"
-type="Job"
-units="whole"
....
the point is, there are multiple material children to a materials parent.
The treeview is name TreeViewForXml
My selectednodechanged callback begins like..
Protected Sub TreeViewForXml_SelectedNodeChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles TreeViewForXml.SelectedNodeChanged
Dim TextToEdit, StringToParse() As String
HideAllEditFields()
ListBoxForOrderInformation.Items.Add("Selected value=" &
TreeViewForXml.SelectedNode.Value & _
" text=" & TreeViewForXml.SelectedNode.Text)
......
The problem is, sometimes if I click on quantity="2" (or any other quantity
that is not in the first material child of materials), the selectednode(or
the message I get in my listbox) is quantity="1"(or always the quantity node
in the first material child of materials). In the above example, there are
3 material children of materials but there could be 20 material children or
more.
I am seeing this happen if I selected partnumber="999", the TreeviewForXml.
SelectedNode is partnumber="123"(the first child in the list of material
children).
What am I doing wrong to trap selectednode?
I know the TreeNodeCollection.IndexOf(treenode) method will return the first
occurrence of a node if it appears multiple times in the collection.
Is this also the rule with a treeview and selectednode?
thanks.