If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

datagridview select row and pass to another datagridview

hi guys i need some help if anyone can

i populate datagridview1 with an sql query and datagridview2 with another sql query. i have to select a row from datagridview1 and on button1 click to pass the row at datagrid2 and the same for datagridview2. select a row from datagrid2 and on button2 click to pass the row at datagridview1

jcb thanks for the code but it helped me find out that i need to create a DataTable first and the row there and them bind it to dgv1.

so wrote some code but doesnt work, if you can check it

Dim copytable As New DataTable
'Dim Row1 As DataRow
'declaring a row for the copytable
Try
Dim foititis_onoma As DataColumn = New DataColumn("foititis_onoma")
' declaring a column named Name
foititis_onoma.DataType = System.Type.GetType("System.String")
'setting the datatype for the column
copytable.Columns.Add(Name)
'adding the column to table
Dim foititis_eponymo As DataColumn = New DataColumn("foititis_eponymo")
foititis_eponymo.DataType = System.Type.GetType("System.String")
copytable.Columns.Add(foititis_eponymo)