Click here to Skip to main content
15,920,111 members

Comments by Member 15089981 (Top 1 by date)

Member 15089981 27-May-21 23:21pm View    
Hello! This solution works fine for me however
I had an error saying that dr.Cells[i].Value.ToString() was having a null error. This was due to the way that Rows are counted, you need to set AllowUserToAddRows to False in the DataGrid OR subtract 2 from the Row Count, i.e.

for (int j = 0; j <= gridIn.Rows.Count - 2; j++)

This solved my issue! Hopefullt this helps anyone coming across the same error.