Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VB.NET datagridview Click event Error message

$
0
0
I put a click event on the datagridview. Im tryin to get the content of this grid to load some textboxes on a second form. But I kept getting error message,

ERRORs
Error 1 'text' is not a member of 'System.Windows.Forms.DataGridViewCell'.
Error 2 'Text' is not a member of 'System.Windows.Forms.DataGridViewCell'.
Error 3 'Text' is not a member of 'System.Windows.Forms.DataGridViewCell'.
Code:

    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridViewCheckEmployee.CellContentClick
        frmNewEmployee.Show()
        Me.Hide()
        frmNewEmployee.txtSureName.Text = DataGridViewCheckEmployee.Rows(e.RowIndex).Cells(1).text
        frmNewEmployee.TxtFirstName.Text = DataGridViewCheckEmployee.Rows(e.RowIndex).Cells(2).Text
        frmNewEmployee.TxtMiddleName.Text = DataGridViewCheckEmployee.Rows(e.RowIndex).Cells(3).Text
        frmNewEmployee.TxtFirstName.Text = DataGridViewCheckEmployee.Rows(e.RowIndex).Cells(4).Text
    End Sub


Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>