Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
TextBox1.Text = IIf(IsDBNull(DataGridView1.CurrentRow.Cells(0).Value), "", DataGridView1.CurrentRow.Cells(0).Value) 'İlgili alan boş ise TextBox'a boş olarak ataması.
TextBox2.Text = IIf(IsDBNull(DataGridView1.CurrentRow.Cells(1).Value), "", DataGridView1.CurrentRow.Cells(1).Value)
TextBox3.Text = IIf(IsDBNull(DataGridView1.CurrentRow.Cells(2).Value), "", DataGridView1.CurrentRow.Cells(2).Value)
TextBox4.Text = IIf(IsDBNull(DataGridView1.CurrentRow.Cells(3).Value), "", DataGridView1.CurrentRow.Cells(3).Value)
TextBox5.Text = IIf(IsDBNull(DataGridView1.CurrentRow.Cells(4).Value), "", DataGridView1.CurrentRow.Cells(4).Value)
TextBox6.Text = IIf(IsDBNull(DataGridView1.CurrentRow.Cells(5).Value), "", DataGridView1.CurrentRow.Cells(5).Value)
TextBox7.Text = IIf(IsDBNull(DataGridView1.CurrentRow.Cells(6).Value), "", DataGridView1.CurrentRow.Cells(6).Value)
TextBox1.Enabled = False 'ilave ediniz
TextBox2.Enabled = False 'ilave ediniz
End Sub
ve
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Temizle()
TextBox1.Enabled = True 'ilave ediniz
TextBox2.Enabled = True 'ilave ediniz
End Sub
yazınız...