Ormond Stock

Ormond Stock

  • NA
  • 18
  • 1.3k

Adding Properties after Adding an Item to a ComboBox

Jan 13 2022 1:18 AM

I can add a series of items to a comboBox as follows:-

            foreach (DataRow row in Variables.ClientsTable.Rows)
            {
                string temp1 = row["CompanyName"].ToString();
                string temp2 = row["CompanyID"].ToString();
                comboBoxProjects20.Items.Add(temp1);
                comboBoxProjects20a.Items.Add(temp2);
            }

However the comboBox then drops down a blank list, which looks to be of the right length.  I assume I need to set the DisplayMember and other properties, but how do I select the just added item to do this?

 


Answers (1)