I have 8 List boxes that update from an xml file, at the moment they populate when they are clicked and the following List boxes update (this is a bit like a family tree) so i can populate all list boxes by clicking on them individually, but if i change one at the top of the tree then only the next one down update what i need is when it is clicked all following boxes go blank out
Example, at the moment all list boxes are populated after being clicked on, if i then click on List box 2, this will update list box 3 only and 4 to 8 remain the same, what i need is for 4 to 8 to go blank.
Solution 1, List Box
Solution 2, List Box
Solution 3, List Box
Solution 4, List Box
Solution 5, List Box
Solution 6, List Box
Solution 7, List Box
Solution 8, List Box
'Private Sub - for Solution 2 list box, select Name from the choices in Root 2 Section 2 of the xml, based on the
'value selected in Section 1 of the xml, each Solution boxes value changes based on the previouse Solution boxes value
Private Sub Solution1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Solution1.Click
Dim Root2 =
(
From a In doc...<Section1>
Where a.@Name = Solution1.Text
From l In a.<Root2>.<Section2>
Select l.@Name
).ToArray
Solution2.DataSource = Root2
End Sub
'Private Sub - for Solution 3 list box
Private Sub Solution2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Solution2.Click
Dim Root3 =
(
From a In doc...<Section1>
Where a.@Name = Solution1.Text
From l In a.<Root2>.<Section2>
Where l.@Name = Solution2.Text
From b In l...<Section3>
Select b.@Name
).ToArray
Solution3.DataSource = Root3
End Sub
'Private Sub - for Solution 4 list box
Private Sub Solution3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Solution3.Click
Dim Root4 =
(
From c In doc...<Section2>
Where c.@Name = Solution2.Text
From l In c.<Root3>.<Section3>
Where l.@Name = Solution3.Text
From d In l...<Section4>
Select d.@Name
).ToArray
Solution4.DataSource = Root4
End Sub
'Private Sub - for Solution 5 list box
Private Sub Solution4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Solution4.Click
Dim Root5 =
(
From f In doc...<Section3>
Where f.@Name = Solution3.Text
From l In f.<Root4>.<Section4>
Where l.@Name = Solution4.Text
From g In l...<Section5>
Select g.@Name
).ToArray
Solution5.DataSource = Root5
End Sub
'Private Sub - for Solution 6 list box
Private Sub Solution5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Solution5.Click
Dim Root6 =
(
From h In doc...<Section4>
Where h.@Name = Solution4.Text
From l In h.<Root5>.<Section5>
Where l.@Name = Solution5.Text
From j In l...<Section6>
Select j.@Name
).ToArray
Solution6.DataSource = Root6
End Sub
'Private Sub - for Solution 7 list box
Private Sub Solution6_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Solution6.Click
Dim Root7 =
(
From k In doc...<Section5>
Where k.@Name = Solution5.Text
From l In k.<Root6>.<Section6>
Where l.@Name = Solution6.Text
From m In l...<Section7>
Select m.@Name
).ToArray
Solution7.DataSource = Root7
End Sub
'Private Sub - for Solution 8 list box
Private Sub Solution7_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Solution7.Click
Dim Root8 =
(
From n In doc...<Section6>
Where n.@Name = Solution6.Text
From l In n.<Root7>.<Section7>
Where l.@Name = Solution7.Text
From o In l...<Section8>
Select o.@Name
).ToArray
Solution8.DataSource = Root8
End Sub

New Topic/Question
Reply



MultiQuote





|