DataGridViewRow row = (DataGridViewRow)yourDataGridView.Rows[0].Clone();
row.Cells[0].Value = "XYZ";
row.Cells[1].Value = 50.2;
yourDataGridView.Rows.Add(row);
DataTable dt = new DataTable();
// first add your columns
for (int i = 0; i < count; i++)
{
dt.Columns.Add(fromFileFields[i]);
}
// and then add your rows
for (int i = 0; i < count; i++)
{
var row = dt.NewRow();
// Set values for columns with row[i] = xy
dt.Rows.Add(row);
}
datagridview.DataSource = dt;