If your text file is exactly what you show:
Line 1
Line 2
Then what you will get is an ArgumentOutOfRangeException rather than "the second line".
So I suspect that your text file doesn't hold exactly what you think it does.
Use the debugger. Put a breakpoint on the line:
var row = new DataGridViewRow();
And use it to look at exactly what ins in
line
- my guess is that it contains "Line 1" followed by 34 spaces and the "Line 2" rather than what you think...