title: Hide item from Combobox temporarily
body: <p>I was wondering if there was a way to temporarily hide or remove an item from a combo box that is being populated from a database?</p>
  
  <p>I have two combo boxes that are being populated by the same column (To and From Machine Number)</p>
  
  <p>You can't really have Motor1 connected to Motor1, and short of having to repopulate an entire combo box with each selection, I was thinking there has to be a way to temporarily hide the same selection from the second combobox.</p>
  
  <p>Please let me know if you need information on how the comboboxes are being populated(code etc.)</p>
  
  <p><strong>EDIT</strong> Here is the population code for the combo boxes:</p>
  
  <pre><code>void PopulateCreateView(CableID_CreateView CView)
  {
      // Creates a new Model, and gets data from the Db.
      CModel = new CableID_Model();
      CModel.CNId = 1;
      Database_Facade.Operation_Switch(OPREAD);
  
      // Populates the form with data for the Plant Area Codes, Supplier Info and Major Equipment.
      foreach (PlantAreaCode_Model Model in PlantAreaCode_Controller.PList)
      {
          CView.cmbAreaCode.Items.Add(Model.AreaName);
          CView.lblDummy.Text = Model.AreaName;
          if (CView.lblDummy.Width &gt; CView.cmbAreaCode.DropDownWidth)
          {
              // Sets the width +20 to allow for the scroll bar.
              CView.cmbAreaCode.DropDownWidth = CView.lblDummy.Width + 20;
          }
      }
  
      foreach (SupplierID_Model Model in SupplierID_Controller.SList)
      {
          if (Model.CondConfig != null) { CView.cmbXsec.Items.Add(Model.CondConfig); }
          if (Model.Insulation != null) 
          { 
              CView.cmbInsulation.Items.Add(Model.Insulation);
              CView.lblDummy.Text = Model.Insulation;
              if (CView.lblDummy.Width &gt; CView.cmbInsulation.DropDownWidth)
              {
                  // Sets the width +20 to allow for the scroll bar.
                  CView.cmbInsulation.DropDownWidth = CView.lblDummy.Width + 20;
              }
          }
      }
  
      foreach (MajorEquipment_Model Model in MajorEquipment_Controller.MeList)
      {
          CView.cmbFromLoc.Items.Add(Model.EqipmentNumber);
          CView.cmbToLoc.Items.Add(Model.EqipmentNumber);
      }
  }
  </code></pre>
  
  <p>Here is the code for the MySQL Query:</p>
  
  <pre><code>public void GetCableId(CableID_Model CModel)
  {
      DbConnect();
  
      try
      {
          MajorEquipment_Controller.MeList = new List&lt;MajorEquipment_Model&gt;();
          mySqlCommand = mySqlConnect.CreateCommand();
          mySqlCommand.CommandText = "SELECT * FROM MajorEquipment;";
          mySqlReader = mySqlCommand.ExecuteReader();
  
          while (mySqlReader.Read())
              {
                  MajorEquipment_Controller.MeList.Add(new MajorEquipment_Model
                  {
                      EqipmentNumber = Convert.ToString(mySqlReader["EquipmentNumber"])
                  });
              }
              mySqlReader.Close();
              mySqlCommand.ExecuteNonQuery();
      }
      catch (MySqlException e) { MessageBox.Show(e.Message); }
      finally
      {
          if (mySqlConnect != null)
          {
              mySqlConnect.Close();
          }
      }
  }
  </code></pre>