title: Datagridview Combobox and Textbox event not firing when data is loading
body: <p>I am creating an application in which datagridview having one combobox and multiple textbox</p>
  
  <p>In datagridview, when I select manually datagridviewcombobox value, Textbox value is filled</p>
  
  <p>But datagridview is populated by bindingsource and value of datagridviewcombobox get selected but textbox value is empty</p>
  
  <p><strong>Example as below</strong></p>
  
  <p>Combobox value selected by user, Account Name textbox filled
  <a href="https://i.stack.imgur.com/IVfbI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IVfbI.png" alt="enter image description here"></a></p>
  
  <p>Combobox value selected by bindingsource(Dynamically), Account Name textbox is Empty</p>
  
  <p><a href="https://i.stack.imgur.com/00a01.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/00a01.png" alt="enter image description here"></a></p>
  
  <p><strong>Below is my code</strong></p>
  
  <pre><code>int journalID = 0;
  public Add(int id = 0)
  {
       BindControls();
       journalID = id;
  }
  
  
    private async void BindControls()
    {
       try
       {               
              if (journalID &gt; 0)
              {
                  List&lt;JournalAccountViewModel&gt; list = await new JournalModel().GetDetailById(journalID);
                  for (int i = 0; i &lt;= list.Count - 1; i++)
                  {
                      bindingSource1.Add(list[i]);
                  }
              }
              else
              {
                  bindingSource1.Add(new JournalAccountViewModel());
                  bindingSource1.List.Clear();
              }
              dgvJournal.AutoGenerateColumns = false;
              dgvJournal.AllowUserToAddRows = true;
              dgvJournal.AutoSize = true;
              dgvJournal.DataSource = bindingSource1;
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.Message, "Rule", MessageBoxButtons.OK, MessageBoxIcon.Error);
          }
      }
  
  
     private void dgvJournal_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
      {
          try
          {
              if (dgvJournal.CurrentCell.ColumnIndex == dgvJournal.Columns[colCredit.Name].Index) //Desired Column
              {
                  TextBox tb = e.Control as TextBox;
                  if (tb != null)
                  {
                      tb.KeyPress += new KeyPressEventHandler(txtNumeri_KeyPress);
                  }
              }
  
              if (dgvJournal.CurrentCell.ColumnIndex == dgvJournal.Columns[ColDebit.Name].Index) //Desired Column
              {
                  TextBox tb = e.Control as TextBox;
                  if (tb != null)
                  {
                      tb.KeyPress += new KeyPressEventHandler(txtNumeri_KeyPress);
                  }
              }
  
  
              ComboBox combo = e.Control as ComboBox;
              if (combo != null)
              {
                  combo.SelectedIndexChanged -= new EventHandler(ComboBox_SelectedIndexChanged);
                  combo.SelectedIndexChanged += new EventHandler(ComboBox_SelectedIndexChanged);
              }
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.Message, "Rule", MessageBoxButtons.OK, MessageBoxIcon.Error);
          }
  
      }
  
  
     private void ComboBox_SelectedIndexChanged(object sender, EventArgs e)
      {
          try
          {
              if (((ComboBox)sender).SelectedItem != null)
              {
                  AccountViewModel account = (AccountViewModel)((ComboBox)sender).SelectedItem;
                  var currentcell = dgvJournal.CurrentCellAddress;
                  DataGridViewTextBoxCell cel = (DataGridViewTextBoxCell)dgvJournal.Rows[currentcell.Y].Cells[ColAccountName.Name];
                  cel.Value = account.Name;
              }
              else
              {
                  ((ComboBox)sender).SelectedIndex = 0;
              }
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.Message, "Rule", MessageBoxButtons.OK, MessageBoxIcon.Error);
          }
      }
  
    private void txtNumeri_KeyPress(object sender, KeyPressEventArgs e)
      {
          try
          {
              if (!char.IsControl(e.KeyChar) &amp;&amp; !char.IsDigit(e.KeyChar) &amp;&amp; e.KeyChar != '.')
              {
                  e.Handled = true;
              }
  
              // only allow one decimal point
              if (e.KeyChar == '.' &amp;&amp; (sender as TextBox).Text.IndexOf('.') &gt; -1)
              {
                  e.Handled = true;
              }
  
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.Message, "Rule", MessageBoxButtons.OK, MessageBoxIcon.Error);
          }
      }
  </code></pre>
  
  <p>Please suggest me how to get textbox value filled when combobox value is set programmtically.</p>