Refresh button – Refreshing data grid view after inserting, deleting, updating

The easiest way to handle this is to use a Binding Source object.

If your loading information into your DataGridView from an Access Database then your most likely storing the Data in a Dataset or DataTable.

Create a Binding Source object, and once you have populated your DataTable/Dataset, set the datasource for your Binding Source to your DataTable. Then set the Datasource from the DataGridView as the Binding Source object.

Doing this ensures that any changes in your datagridview or reflected in the DataTable and vice Versa. If you reload data into your DataTable it will reflect in the Data Grid Automatically.

DataTable dt = new DataTable();

BindingSource bs = new BindingSource();

bs.DataSource = dt;

dataGridView1.DataSource= bs;

All changes will now happen automatically.

Leave a Comment