title: pass checked datagridview rows from child form to main form datagridview
body: <p>I have 2 forms</p>
  
  <ul>
  <li>ApodeikseisTimologion</li>
  <li>EggrafesTimologionEsodon</li>
  </ul>
  
  <p><code>ApodeikseisTimologion</code> is the main form and <code>EggrafesTimologionEsodon</code> is the childform and 1 datagridview (<code>dataGridViewProionApodeixeisTimologiouEsodon</code> and <code>dataGridViewEggrafesProionParastikouEsodon</code>) in each form.</p>
  
  <p><code>DataGridViewProionApodeixeisTimologiouEsodon</code> belongs to main form and <code>dataGridViewEggrafesProionParastikouEsodon</code> belongs to child form.
  Now, I want to pass the checked values from the child form to parent form without losing the values that i have already put in other textboxes in parent form.
  Here is my code:</p>
  
  <p>Form ApodeikseisTimologion.
  I use this to open the child form</p>
  
  <pre><code>private void LinkLblEisagogiEggrafon_Click(object sender, EventArgs e) {
      EggrafesTimologionEsodon eggrTimolEsodon = new EggrafesTimologionEsodon(cmbBoxEponimiaPelatiApodeixeisTimologiouEsodon.Text);
      eggrTimolEsodon.ShowDialog();
      this.Refresh();
  }
  </code></pre>
  
  <p>Form EggrafesTimologionEsodon</p>
  
  <pre><code>private void EggrafesTimologionEsodon_Load(object sender, EventArgs e) {
      try {
  
          con = new SqlConnection();
          con = DBAccess.Conn;
          con.Open();
  
          adap = new SqlDataAdapter("select ProionParastatikou.* from ProionParastatikou inner join Parastatiko on ProionParastatikou.ParastatikoID = Parastatiko.ParastatikoID" +
                                        " where ProionParastatikou.Ypoloipo &gt; 0.00  and Parastatiko.Eponimia = '" + txtPelatisId.Text + "'", con);
          ds = new System.Data.DataSet();
          adap.Fill(ds, "BsProionParastatikouEsodon");
          dataGridViewEggrafesProionParastikouEsodon.DataSource = ds.Tables[0];
          con.Close();
      }
  
      catch (Exception ex) {
          MessageBox.Show("Error\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
      }
  
      finally {
          if (MyConn.State != ConnectionState.Closed)
              MyConn.Close();
          }
      }
  </code></pre>
  
  <p>I have this image : </p>
  
  <p><a href="https://i.stack.imgur.com/09zsF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/09zsF.png" alt="enter image description here"></a></p>
  
  <p>in the child form i also have this to check the rows from the checkbox column of the datagridview and stored them to a list to transfer them to the parent form without losing the other data that i have already.</p>
  
  <pre><code>private void BtnProsthikiEggrafon_Click(object sender, EventArgs e) {
      ApodeixeisTimologion apo = new ApodeixeisTimologion(null);
      List&lt;Int64&gt; lst2send = new List&lt;Int64&gt;();
      Int64 toSend;
  
      foreach (DataGridViewRow eggrafes in dataGridViewEggrafesProionParastikouEsodon.Rows) {
          if (Convert.ToBoolean(eggrafes.Cells["CheckBoxColumn"].Value)) {
              int RowIndexCheck = eggrafes.HeaderCell.RowIndex;             
                   Int64.TryParse(dataGridViewEggrafesProionParastikouEsodon.Rows[RowIndexCheck].Cells["proionParastatikouIDDataGridViewTextBoxColumn"].Value.ToString(),out toSend);
                  lst2send.Add(toSend);
              }
          }
  
          apo.AfterProsthikiProionParastatikou(null, null, lst2send);
          //apo.Refresh();
          this.Close();
      }
  </code></pre>
  
  <p>When the child form close, I have that in parent Form:</p>
  
  <pre><code>public void AfterProsthikiProionParastatikou(object sender,EventArgs e,IList&lt;Int64&gt; lst) {
      String csvLst = string.Empty;
      int count = 0;
  
      foreach ( Int64 lstItems in lst) {
          if (count == 0) {
              csvLst = lstItems.ToString();
              count += 1;
          }
          else {
              csvLst = csvLst + "," + lstItems.ToString();
          }
      }
  
       _con = new SqlConnection();
       _con = DBAccess.Conn;
       _con.Open();
  
       adap = new SqlDataAdapter("select ProionParastatikou.* from ProionParastatikou where" +
              " ProionParastatikou.Ypoloipo &gt; 0.00  and ProionParastatikou.ProionParastatikouID"+
              " in( " + csvLst + ")", _con);
  
       ds = new System.Data.DataSet();
       adap.Fill(ds, "bsProionApodeixeisTimologiouEsodon");//
       dataGridViewProionApodeixeisTimologiouEsodon.DataSource = ds.Tables["bsProionApodeixeisTimologiouEsodon"];
       //dataGridViewProionApodeixeisTimologiouEsodon.Refresh();
       _con.Close();
  
   }
  </code></pre>
  
  <p>i make a breakpoint in </p>
  
  <pre><code>ds = new System.Data.DataSet();
  adap.Fill(ds, "bsProionApodeixeisTimologiouEsodon");//
  dataGridViewProionApodeixeisTimologiouEsodon.DataSource = ds.Tables["bsProionApodeixeisTimologiouEsodon"];
  </code></pre>
  
  <p>And i see that the ds fills with the correct values but rows are not coming in the dataGridViewProionApodeixeisTimologiouEsodon which is the grid in parent form.</p>
  
  <p>In all the forms i am using datasets and bindingSources in datagrids, and the datagrids are bounded except of the checkbox column.
  Can somebody helps.
  If someone needs more help i will give it.</p>