Make sure you do a guard check on your Text
property for each Row Cell
. It is possible that the text is whitespace
or empty
.
Sample guard check.
if(string.IsNullOrWhiteSpace(e.Row.Cells[5].Text) ||
string.IsNullOrWhiteSpace(e.Row.Cells[3].Text))
return;