Hello to you all...
I have 2 forms, each one with a datagridview.
I want to transfer all the DataGridView Rows from From2 to another DataGridView of Form1... but it's not possible... why ?
None of DGV's is bounded... all it's programmatically data...Code:Public Sub publicare_parteneri() For Each row As DataGridViewRow In Me.dgv_lista_parteneri_proiect.Rows Dim n As Integer = frm_gestionare_proiecte.dgv_parteneri.Rows.Add() frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(0).Value = row.Cells(0).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(1).Value = row.Cells(1).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(2).Value = row.Cells(2).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(3).Value = row.Cells(3).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(4).Value = row.Cells(4).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(5).Value = row.Cells(5).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(6).Value = row.Cells(6).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(7).Value = row.Cells(7).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(8).Value = row.Cells(8).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(9).Value = row.Cells(9).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(10).Value = row.Cells(10).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(11).Value = row.Cells(11).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(12).Value = row.Cells(12).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(13).Value = row.Cells(13).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(14).Value = row.Cells(14).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(15).Value = row.Cells(15).Value frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(16).Value = frm_gestionare_proiecte.txt_id_proiect.Text frm_gestionare_proiecte.Validate() frm_gestionare_proiecte.dgv_parteneri.EndEdit() frm_gestionare_proiecte.dgv_parteneri.Update() 'MessageBox.Show(frm_gestionare_proiecte.dgv_parteneri.Rows(n).Cells(4).Value.ToString & vbCrLf & vbCrLf & n.ToString, "Valoare", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Next End Sub
What's wrong ?




Reply With Quote