How can I save my dataGridView
in an array of objects. Each row is an object where each column is an attribute of that object. I have my array sTcCnfArray
of type sTcCnf
. I do not know if doing it with a BindingSource
(it would be something like this):
BindingSource CantonesBindingSource;
CantonesBindingSource = (BindingSource)dataGridViewTcCnf.DataSource;?? (me pone que es null)
CantonesBindingSource.CopyTo(TcCnfArray, 0);
Or go from cell to cell assigning the values (less good):
sTcCnfArray[0].IdApp = Convert.ToByte(datagridview1.Rows[0].Cells[0]);
etc.
How could I do it?