"when I close the first form and open again when I open second form and transfer data"
The simple solution
may be to not close the first form, but use 'Hide so it stays active, clearing whatever is in the Form as necessary.
I say "may" because your question and code do not give me enough information to
fully understand what you are doing.
A DataGridview
is a strongly typed collection of Columns: they must be defined at design-time, or added in run-time code before you add Rows. CellType and CellTemplate should be set to avoid errors: [
^]
In general, I would avoid creating a bunch of Controls in run-time code; I would try to re-use an existing Form with a TableLayoutPanel populated with the Controls