Hey All,
I've got a datagridview populated with data from a database. I'm trying to run this piece of code to get data from one of the cell. It works but when I reorder the grid by clicking on the column header I get a
"A first chance exception of type 'System.NullReferenceException' occurred"
and it points to the only line of code in the sub
no idea what this could be.
Please help.
Thanks
*******EDIT******
Don't know who did it, but I appreciate the move. Sorry for posting to the wrong section.
I've got a datagridview populated with data from a database. I'm trying to run this piece of code to get data from one of the cell. It works but when I reorder the grid by clicking on the column header I get a
"A first chance exception of type 'System.NullReferenceException' occurred"
and it points to the only line of code in the sub
VB.NET:
Private Sub dgvMasterList_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgvMasterList.SelectionChanged
txtOldAssetTag.Text = dgvMasterList.Rows(dgvMasterList.CurrentRow.Index).Cells(7).Value()
End Sub
no idea what this could be.
Please help.
Thanks
*******EDIT******
Don't know who did it, but I appreciate the move. Sorry for posting to the wrong section.
Last edited: