You are doing it wrong!
First of all, you can't initiate variable inside
IsNothing
function, because the underlined part of line is interpreted by compiler like a boolean value (a result of comparison):
If IsNothing(strCellValue = tabledgv.Rows(newNum).Cells(1).Value.ToString()) Then
Boolean value will never return null/nothing!
comparison of strCellValue to the tabledgv cell Value
"" = "" ' returns true
"" = "some value" ' returns false
If your DataGrdView object is bind to the datatable of SQL database, i'd change it to:
If DbNull.Value.Equals(tabledgv.Rows(newNum).Cells(1).Value) Then
For further details, please see:
Comparison Operators - Visual Basic | Microsoft Docs[
^]
Information.IsNothing(Object) Method (Microsoft.VisualBasic) | Microsoft Docs[
^]
DBNull.Value Field (System) | Microsoft Docs[
^]