title: Running two DataGridViews in a foreach loop that needs to run line by line
body: <p>I have two DataGrids(Documentos and OCR) and i need to run both of them inside a foreach loop that is activated when the Importar(Import) button is pressed and i need to have them run both of those grids line by line. How can i do that? And what do i put inside the foreach().</p>
  <pre><code>switch (TabControl.SelectedTab.Name)
          {
              case &quot;Clientes&quot;:
  
                  
                  foreach ()
                  {
                      DataTable dataTableDocs = (DataTable)dataGridViewDocumentos.DataSource;
  
                  }
  
                  ;
                  break;
  
              case &quot;2&quot;:
                  Console.WriteLine(&quot;Case 2&quot;);
                  break;
              default:
                  Console.WriteLine(&quot;Default case&quot;);
                  break;
          }
  
  
      }
  </code></pre>
  <p>This is my btn_Import event</p>
  <p>And these are my two DataGrids</p>
  <pre><code>private void FillDGVDocs1(int JobID, int Status)
      {
  
          int DocID;
          int BatchID;
          dataGridViewDocumentos.DataSource = null;
          dataGridViewDocumentos.Columns.Clear();
          dataGridViewDocumentos.Refresh();
          DataTable dt = da.SP_SELECT_DOCS_WHERE_JOBID_STATUS_IBML1 (JobID, Status);
          dataGridViewDocumentos.DataSource = dt;
  
          //dataGridViewDocumentos.Columns[1].HeaderText = &quot;Caixa&quot;;
          //dataGridViewDocumentos.Columns[2].HeaderText = &quot;DOC&quot;;
          //dataGridViewDocumentos.Columns[3].HeaderText = &quot;ID&quot;;
          //dataGridViewDocumentos.Columns[4].HeaderText = &quot;PROC&quot;;
  
          DocID = Convert.ToInt32(dt.Rows[0][&quot;DocID&quot;].ToString());
          BatchID = Convert.ToInt32(dt.Rows[0][&quot;BatchID&quot;].ToString());
          FillDGVOCR(DocID, BatchID);
  
      }
  </code></pre>