In this post we completely teach how to show DataGridView data in TextBox. This is a very simple task. For this we just have to take a DataGridView and custom text box. After that using the coding as per the instruction of the video. This coding is required by us in database management software.
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
If e.RowIndex >= 0 Then
Dim Tablerow As DataGridViewRow
Tablerow = Me.DataGridView1.Rows(e.RowIndex)
TextBox1.Text = Tablerow.Cells("Name").Value.ToString
TextBox2.Text = Tablerow.Cells("Class").Value.ToString
TextBox3.Text = Tablerow.Cells("Reg").Value.ToString
TextBox4.Text = Tablerow.Cells("Address").Value.ToString
End If
End Sub