It's not entirely clear, but you seem to be saying that adding
row.Cells["RN"].Value.ToString() == null
causes a problem. By "don't work" I am taking it to mean that you get an exception raised when you run the program and that cell is null.
I believe it is because you are trying to execute the .ToString() method on a null instance - which will cause an error.
Instead of using .ToString, test for the actual
value being null i.e.
row.Cells["RN"].Value == null