Why am I getting an InvalidCastingException at the ".RowCount = 2" line?
Private Sub frmTesting_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
With DataGridView1
.RowCount = 2
.Item(0, 0).Value = 1
.Item(1, 0).Value = "testing1"
.Item(0, 1).Value = 2
.Item(1, 1).Value = "testing2"
End With
End Sub
Any help would be greatly appreciated.
Thanks.
Private Sub frmTesting_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
With DataGridView1
.RowCount = 2
.Item(0, 0).Value = 1
.Item(1, 0).Value = "testing1"
.Item(0, 1).Value = 2
.Item(1, 1).Value = "testing2"
End With
End Sub
Any help would be greatly appreciated.
Thanks.
Last edited: