Click here to Skip to main content
15,887,821 members

Response to: How to move selected rows of one datagridview to another datagridview.

Latest Revision
Hi,
this code might help you.

Dim DsTo As New DataSet '' '' Dataset for to DatagridView

'' '' Code on button Click
      for DgvToFor Each r As DataGridViewRow In DGVFrom.SelectedRows
           Dim Drto As DataRow = DsTo.Tables(0).NewRow
           For c As Integer = 0 To DGVFrom.ColumnCount - 1
               Drto(c) = r.Cells(c).Value
           Next
           DsTo.Tables(0).Rows.Add(Drto)
           DGVFrom.Rows.Remove(r)
       Next



RKS
Posted 31-Dec-12 22:11pm by Rahul K Singh.
Tags: