Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:47:11+00:00 2026-06-07T09:47:11+00:00

I have got two comboboxes on my application. The first combobox can get all

  • 0

I have got two comboboxes on my application. The first combobox can get all the required data (in this case it is the factory numbers) however depending on which factory is selected I want the next combo box (in this case line numbers) to automatically populate with the correct lines for that factory.
Here is my XML file – or a test data

<?xml version="1.0" encoding="utf-8"?>
<Profiles>
<Factories>
  <Factory>F1</Factory>

  <Factory>F2</Factory>

  <Factory>F3</Factory>

  <Factory>F4</Factory>

  <Factory>F5</Factory>
  <Factory>F6</Factory>
  <Factory>F7</Factory>
  <Factory>F8</Factory>
</Factories>

  <Lines>
    <F1>G1</F1>
    <F1>G2</F1>
    <F1>G3</F1>
  </Lines>
</Profiles>

Here is what I have so far:

Private Sub populateComboBoxes()
    Dim doc As New XmlDocument()
    doc.Load("C:\TFS2010Source\ShopFloorApps\Main\Source\Components\000280LinePCBackup\000280LinePCBackup\Lines.XML")

    Dim factoryList As XmlNodeList = doc.SelectNodes("/Profiles/Factories/Factory")
    For Each Factory As XmlNode In factoryList
        factoryComboBox.Items.Add(Factory.InnerText)
    Next



End Sub

Private Sub factoryComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles factoryComboBox.SelectedIndexChanged
    Dim doc As New XmlDocument()
    doc.Load("C:\TFS2010Source\ShopFloorApps\Main\Source\Components\000280LinePCBackup\000280LinePCBackup\Lines.XML")


    Dim lineList As XmlNodeList = doc.SelectNodes("/Profiles/Lines")

    For Each line As XmlNode In lineList


        If factoryComboBox.SelectedItem.ToString = line.FirstChild.Name Then


            lineComboBox.Items.Add(line.FirstChild.InnerText)


        End If
        Next
End Sub

So What I want is when I select F1 the other combobox populates with the line G1,G2 and G3.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:47:12+00:00Added an answer on June 7, 2026 at 9:47 am

    You have to clear the Items collection of lineComboBox and also change the SelecteNodes path.

    lineComboBox.Items.Clear()
    Dim lineList As XmlNodeList = doc.SelectNodes("/Profiles/Lines/" & factoryComboBox.SelectedItem.ToString)
    For Each line As XmlNode In lineList
        lineComboBox.Items.Add(line.FirstChild.InnerText)
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got two pages. example.com/php.com and example.com. I use this function to set
I've got two models Category and Item. Category can have many items and item
I have got two movieclips on the main timeline. First one is envelope_mc and
I've got a problem. I have got two servers on first I've got my
I have got two simple questions How can I tell what server is a
i have got two view. First: FirstViewController Second: SecondViewController FirstViewController is my UINavigationController 's
Ok so this is kind of a strange issue, but I have got two
Background: I've got a WinForm application with a ComboBox and a TabControl with two
I have got two kind of entities, comments and tasks. Both types can be
I have a little problem. At my application Im always building two linked combobox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.