I think you leave an empty cell and try to process its value.
when you leave an empty cell value of the following code:
string entry = dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString();
Value
the line in the record will be empty (entry = "") and when you process this value, passing it to another function [MakeTextFeet (record);] it gives you an error.
The solution from my point of view for this problem: →>
put each line of code in the above method and MakeTextFeet (Entry) also in the try block.
When you write a catch block, leave this block empty. For instance.
try { . . . } catch(Exception) { }
With this case, your exception will naturally be caught, but since it is void, it will not show you.
source share