2017-01-23 13 views
0

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 

フォームが

+0

を表示するだけでfrm.showを必要とする、あなたのコードをフォーマットするいくつかの時間を費やす読む[掲載]と[ツアー]を行ってください(ツールバーにヘルプボタンと書式設定ツールがあります) – Plutonix

+0

こんにちはplutonix私はちょうどコードを更新しました。ごめんなさい – Trajkovski

+0

あなたはそのメソッドで新しいフォームインスタンスを作成しますが、表示しませんそれは問題ですか? DGVにはどのように人口が集まったのですか? *データ*を他のフォームに渡して、それ自身のコントロールにデータを代入させる方が良い – Plutonix

答えて

0

私のデータが表示されていない私は、フォーム

関連する問題