Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
VB
Private Sub dgv_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv1.CellContentClick
      Dim drExisting As DataRow
      Try
          dgv2.DataSource = New DataView(ds.Tables(0))
          dgv2.DataSource = Nothing
          If (dgv.SelectedRows.Count > 0) = True Then
              'Create new row to hold duplicated values
              Dim NewRow As DataGridViewRow = dgv.SelectedRows
              'Add newly create row to table
              Me.dgv2.Rows.Add(NewRow)
          End If
      Catch ex As Exception
          Call ShowError(ex)
      End Try

  End Sub


i need DATAGRIDVIEW dgv1 selected value copy or add in dgv2
plz help

but there is one another issue that there is not fix column in dgv1 ,,, means change query every time
Posted
Comments
syed shanu 18-Mar-14 1:24am    
Chk this link might be helpfull to you.
http://www.aspdotnet-suresh.com/2013/05/move-selected-gridview-rows-to-another.html
saimm 18-Mar-14 1:28am    
there is specific column but i dont have same column every time dgv1 column may be change

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900