title: Combobox does not revert to null when value is cleared
body: <p>Due to a flaw in .NET (Microsoft says its intended but I see it as a serious flaw)
  If a user empties a combo box (i.e. wants to blank out the value) the selected value does not revert to null instead it keeps the last valid selected value, so when you save with a blank combobox it goes back to the original value.One workaround is to first choose a different option from the drop down, then blank it out and it will work properly. However, that's not something users of an application would prefer. </p>
  
  <p>So is there a way that I can fix this. Or is it possible that I can add an option for "NONE" which will then change the value in the database to NULL. Note: Combobox has data-binding and I was not able to add the option none for Names. </p>
  
  <p>Contents of the Form.Desginer.cs:</p>
  
  <pre><code>private void InitializeComponent()
      {
        ......
        this.cmbSecCSR = new System.Windows.Forms.ComboBox();
        this.csrBindingSource2 = new System.Windows.Forms.BindingSource(this.components);
        .....
         // 
          // pnlCSRs
          // 
          this.pnlCSRs.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
          this.pnlCSRs.Controls.Add(this.cmbSecCSR);
          ......
         // 
          // cmbSecCSR
          // 
          this.cmbSecCSR.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
          this.cmbSecCSR.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
          this.cmbSecCSR.DataSource = this.csrBindingSource2;
          this.cmbSecCSR.DisplayMember = "Name";
          this.cmbSecCSR.FormattingEnabled = true;
          this.cmbSecCSR.Location = new System.Drawing.Point(112, 26);
          this.cmbSecCSR.Margin = new System.Windows.Forms.Padding(0);
          this.cmbSecCSR.Name = "cmbSecCSR";
          this.cmbSecCSR.Size = new System.Drawing.Size(184, 21);
          this.cmbSecCSR.TabIndex = 2;
          this.cmbSecCSR.ValueMember = "Username";
  
          this.cmbSecCSR.TextChanged += new System.EventHandler(this.comboBox_TextChanged);
          this.cmbSecCSR.Enter += new System.EventHandler(this.cmbBox_Entered);
          // 
          // csrBindingSource2
          // 
          this.csrBindingSource2.DataMember = "CSR";
          this.csrBindingSource2.DataSource = this.productionDS;
          //..............
     }
  </code></pre>
  
  <p>Above are the bits and pieces related to this combobox (I'm just fixing bugs in the application, and a newbie in C#.</p>
  
  <p>The contents related to this combobox in the .CS file are the following:</p>
  
  <pre><code>private void loadDetails()
     {
       this.productionCrewTableAdapter.FillByProductionID(this.productionDS.ProductionCrew, productionID);
  cmbSecCSR.DataBindings.Add("SelectedValue", productionMasterBindingSource, "CSR2", true, DataSourceUpdateMode.OnPropertyChanged);
  }
    private void comboBox_TextChanged(object sender, EventArgs e)
      {
          ComboBox cmbx = (ComboBox)sender;
          if (cmbx.Equals(cmbCamSupplier))
          {
  
          }
          else if (cmbx.Equals(cmbLGSupplier))
          {
  
          }
          if (cmbx.Text.Length &gt; 0) return;
          cmbx.ResetText();
          cmbx.SelectedIndex = -1;
      }
  
   private void cmbBox_Entered(object sender, EventArgs e)
      {
          ComboBox cmb = (ComboBox)sender;
          String txt = cmb.Text;
          if (cmb.Name.Contains("CSR"))
          {
              if (cmb != null)
              {
                  ((BindingSource)cmb.DataSource).Filter = (cmbOffice.SelectedIndex &gt; -1 ? "Office = '" + cmbOffice.SelectedValue + "' AND " : "") + "IsCSR=1 AND Status=1";
                  cmb.Text = txt;
              }
          }
          else if (cmb.Name.Contains("RC"))
          {
              int department = 0;
              if (cmb != null)
              {
                  if (cmb.Name.Contains("Camera"))
                      department = 2;
                  else if (cmb.Name.Contains("LG"))
                      department = 3;
                  else if (cmb.Name.Contains("Power"))
                      department = 4;
                  ((BindingSource)cmb.DataSource).Filter = (cmbOffice.SelectedIndex &gt; -1 ? "Office = '" + cmbOffice.SelectedValue + "' AND " : "") + "IsCSR=0 AND Status=1 AND (Department = " + department + " OR Department is null OR Department = 0)";
                  cmb.Text = txt;
              }
          }
      }
  </code></pre>
  
  <p>If anyone can help me with this issue that I have been struggling with for a while, I'd really really appreciate it. </p>