title: looping through datagridview
body: <p>Mine is a windows app. containing forms named BOM nd BOMSelected..</p>
  
  <p>There is datagridview in BOM which contains checkbox column.. When the user selects checkbox, the selected rows should be seen in the datagridview of other form, SelectedBom..</p>
  
  <p>I have coded but don't get it working.. Some error..</p>
  
  <p>Can you please help ??</p>
  
  <p>Your Help is greatly appreciated..</p>
  
  <p>Here is what i have done !!</p>
  
  <pre><code>Public Class SelectedBom
  
      Private Sub SelectedBom_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          'TODO: This line of code loads data into the 'HemDatabase1DataSet4.partno' table. You can move, or remove it, as needed.
          'Me.PartnoTableAdapter.Fill(Me.HemDatabase1DataSet4.partno)
  
          Dim count As Integer = 0
  
          For j As Integer = 0 To BOM.dgv1.RowCount - 1
  
              If BOM.dgv1.Rows(j).Cells(0).Value = True Then
  
                  Dim ro As New DataGridViewRow
                  DataGridView2.Rows.Add(ro)
  
                  For i As Integer = 0 To BOM.dgv1.ColumnCount - 1
                      Me.DataGridView2.Rows(count).Cells(i).Value = BOM.dgv1.Rows(j).Cells(i).Value
                  Next
  
                  count += 1
  
              End If
  
          Next
  
      End Sub
  End Class
  </code></pre>