Hello.
Could somebody explain why this code snippet is not working?
The arrow (<----) points to where it's going wrong. It goes wrong when building, with the error of:
"An error occurred creating the form. See Exception.InnerException for details. The error is: Index was out of range. Must be non-negative and less than the size of the collection."
Private Sub DataTable_CellChanged(sender As Object, e As DataGridViewCellEventArgs) Handles DataTable.CellValueChanged
If (e.ColumnIndex = 1) Then
If (IsNumeric(DataTable.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) <----) Then
DataTable.Item(e.ColumnIndex, e.RowIndex).Value = 5
DataTable.Item(e.ColumnIndex, e.RowIndex).Style.BackColor = Color.Red
End If
End If
End Sub