I have been trying to synchronize a database trough a DataGridView. So far I have created a data model class. This class contains multiple Properties that match
You need to use the BindingSource object. This will keep your DataTable synchronized with the DataGridView.
So set the DataSource of the BindingSource to the table, then set the DataSource of the DataGridView to the BindingSource.
Example:
// DataGridView
DataGridView dg = new DataGridView();
// BindingSource (used for synchronizing table and grid)
BindingSource bs = new BindingSource();
// Set DataSource of BindingSource to table
bs.DataSource = table;
// Set grid DataSource
dg.DataSource = bs;
To update the underlying database you would usually call
bindingsource.EndEdit();
dataAdapter.Update(dataTable);
Here's a tutorial and a bit more in-depth info about the binding source object:
Saving Data from Application to Database (msdn):
Data Binding using LINQ to SQL in C#