MySQL VB.NET Tutorial 13 : Display selected row from datagridview to TextBox




Moving Datarow from datagridview to textboxes VB.NET Passing data from selected row in DataGridView to Visual Basic VB.NET – how to load selected data …

Original source


19 responses to “MySQL VB.NET Tutorial 13 : Display selected row from datagridview to TextBox”

  1. I'm using visual studio 2015 but the codes cant work, i followed carefully the tutorial but still the correspondant values in my datagridview from my database, still the value doesnt show in my textboxes.

  2. for example
    Private Sub dgvAreas_MouseClick(sender As Object, e As MouseEventArgs) Handles dgvAreas.MouseClick
    Dim codigo As String = dgvAreas.SelectedRows(0).Cells(1).Value
    Dim nombre As String = dgvAreas.SelectedRows(0).Cells(2).Value
    Dim abrev As String = dgvAreas.SelectedRows(0).Cells(3).Value
    Dim noasig As String = dgvAreas.SelectedRows(0).Cells(4).Value
    Dim orden As String = dgvAreas.SelectedRows(0).Cells(5).Value
    txtCodigo.Text = codigo
    txtNombre.Text = nombre
    txtAbrev.Text = abrev
    txtNoAsignaturas.Text = noasig
    txtOrden.Text = orden
    End Sub

  3. Hi ! I am using DevExpress with VB.NET. And I got an error on this line : row = Me.DataGridView1.Rows(e.RowIndex)
    It's show: 'Rows' is not a member of 'DevExpress.XtraGrid.GridControl' . Can you help me please? Thank You for advance.

  4. Great videos, but in this one the code does not work correctly,
    There is a bug in  DataGridView1_CellContentClick, in the CellContentClick argument, all the tutorials explain it this way but its faulty, you should be using DataGridView1_CellClick, ie the CellClick argument with the code, you can see the problem in your video when you click eid 3 and 4 noting happens this is the bug that has not been fixed. it will always work if you use CellClick. John, Easy2pc Ltd.

Leave a Reply