从另一个表单传递datagridview

时间:2017-01-23 00:59:59

标签: vb.net datagridview

将数据从datagridview显示到另一种形式,我尝试了不同的方法,但它们似乎都没有用,所以这就是我试过的。

Private Sub DataGridView1_Click(sender As Object, e As EventArgs) Handles DataGridView1.Click
    Dim frm As New EvidentnaLista



    frm.TextBoxMaticen.Text = DataGridView1.CurrentRow.Cells(0).Value.ToString()

    frm.TextBoxOddelenie.Text = DataGridView1.CurrentRow.Cells(1).Value.ToString()
    frm.TextBoxPrezimeIimeNaNositel.Text = DataGridView1.CurrentRow.Cells(2).Value.ToString()
    frm.TextBoxLekLiceIAdresa.Text = DataGridView1.CurrentRow.Cells(3).Value.ToString()
    frm.TextBoxSrodstvo.Text = DataGridView1.CurrentRow.Cells(4).Value.ToString()
    frm.TextBoxGradSelo.Text = DataGridView1.CurrentRow.Cells(5).Value.ToString()
    frm.TextBoxOpstina.Text = DataGridView1.CurrentRow.Cells(6).Value.ToString()
    frm.TextBoxDrzava.Text = DataGridView1.CurrentRow.Cells(7).Value.ToString()
    frm.TextBoxStalnoMesto.Text = DataGridView1.CurrentRow.Cells(8).Value.ToString()
    frm.TextBoxBrojNaLicna.Text = DataGridView1.CurrentRow.Cells(9).Value.ToString()
    frm.TextBoxZanimanje.Text = DataGridView1.CurrentRow.Cells(10).Value.ToString()
    frm.TextBoxKadeEVraboten.Text = DataGridView1.CurrentRow.Cells(11).Value.ToString()
    frm.TextBoxBrojNaZdrKniska.Text = DataGridView1.CurrentRow.Cells(12).Value.ToString()
    frm.TextBoxBrojNaUpat.Text = DataGridView1.CurrentRow.Cells(13).Value.ToString()
    frm.TextBoxMkbBroj.Text = DataGridView1.CurrentRow.Cells(14).Value.ToString()
    frm.TextBoxPodatociZaBlz.Text = DataGridView1.CurrentRow.Cells(15).Value.ToString()
    'frm.TextBoxDatum.Text = selred.Cells(17).Value.ToString

End Sub
End Class

表单未显示我的数据

1 个答案:

答案 0 :(得分:0)

我只需要frm.show来显示表单