Looping in Datagridview

Discussion in 'Software' started by Ruchi22, Oct 15, 2011.

  1. Ruchi22

    Ruchi22

    Joined:
    Sep 23, 2011
    Messages:
    3
    Mine is a windows app. containing forms named BOM nd BOMSelected..

    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..

    I have coded but don't get it working.. Some error..

    Can you please help ??

    Your Help is greatly appreciated..

    Hers is what i have done !!

    Public Class SelectedBom
    Code:
        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
     
    Ruchi22, Oct 15, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jayjwa

    Yet Another IE Vulnerability??- Frame Looping

    jayjwa, Nov 12, 2003, in forum: Computer Security
    Replies:
    5
    Views:
    615
    @micro$oft.com
    Nov 13, 2003
  2. Razwan

    Convert DataGridView to XML

    Razwan, Aug 27, 2009, in forum: Software
    Replies:
    0
    Views:
    1,345
    Razwan
    Aug 27, 2009
  3. jedlarosa

    Help In Using Datagridview In Csharp

    jedlarosa, Dec 2, 2009, in forum: General Computer Support
    Replies:
    0
    Views:
    2,033
    jedlarosa
    Dec 2, 2009
  4. mpv55
    Replies:
    0
    Views:
    1,634
    mpv55
    Feb 13, 2010
  5. Ruchi22

    Datagridview + checkbox + button

    Ruchi22, Sep 28, 2011, in forum: Software
    Replies:
    0
    Views:
    1,095
    Ruchi22
    Sep 28, 2011
Loading...

Share This Page