private DataTable GetDataTableFromDataGridview(DataGridView _grid)
{
{
var _oDataTable = new DataTable();
object[] cellValues = new object[_grid.Columns.Count];
//clearTable();
_oDataTable.Columns.Add("Name", typeof(string));
_oDataTable.Columns.Add("Value", typeof(string));
_oDataTable.Columns.Add("Font", typeof(string));
_oDataTable.Columns.Add("DateStamp", typeof(string));
_oDataTable.Columns.Add("Comment", typeof(string));
foreach (DataGridViewRow row in _grid.Rows)
{
for (int i = 0; i < row.Cells.Count; i++)
{
cellValues[i] = row.Cells[i].Value;
}
_oDataTable.Rows.Add(cellValues.ToArray());
}
return _oDataTable;
}
}