title: How to copy whole column from one datagridview to another?
body: <p><img src="https://i.stack.imgur.com/ba80J.png" alt="enter image description here"></p>
  
  <p>There are two datagridview (dgvReport and dgvReport2). dgvReport shows data from server after choosing the fields (which is working fine).</p>
  
  <p>The checkboxes are the name of columns in dgvReport. If a user selects "Email" for example the column and its row data of "Email" should be added to dgvReport2.</p>
  
  <p>My problem is when I select more than one checkbox the output of row is shown only at first column of dgvReport2 not under the appropriate column. For example, in the screenshot the column "fname" data is showing under email column of dgvReport2. </p>
  
  <p>How can I bring the row data under appropriate column?</p>
  
  <p>Below is my coding:</p>
  
  <pre><code>'Add dynamic column
  Dim newCol As Integer = 0
  
  If chkEmail.Checked = True Then
      Dim column As New DataGridViewTextBoxColumn
      dgvReport2.Columns.Insert(newCol, column)
  
      With column
          .HeaderText = "email"
          .AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
          .ReadOnly = True
      End With
  
      For rows As Integer = 0 To dgvReport.Rows.Count - 1
          For colcnt As Integer = 0 To dgvReport.Columns.Count - 17
              dgvReport2.Rows.Add(dgvReport.Rows(rows).Cells(0).Value)
          Next
      Next
  
      newCol += 1
  End If
  
  If chkFname.Checked = True Then
      Dim column As New DataGridViewTextBoxColumn
      dgvReport2.Columns.Insert(newCol, column)
  
      With column
          .HeaderText = "fname"
          .AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
          .ReadOnly = True
      End With
  
      For rows As Integer = 0 To dgvReport.Rows.Count - 1
          For colcnt As Integer = 0 To dgvReport.Columns.Count - 17
              dgvReport2.Rows.Add(dgvReport.Rows(rows).Cells(1).Value)
          Next
      Next
      newCol += 1
  End If
  </code></pre>