.NET 2005 - DataGridView - Updating data from a different form...slow to refresh. -
12-19-2007
, 02:43 PM
Hi There.
I have a strange problem. I have a standard DataGridView that
displays on a specific form. This DGV is populated via a DataTable
that is generated from a simple Access Query and works great.
I have an "Add Record" button that opens a new form that allows the
user to enter another record. Once that form has been completed, a
new entry is added to the database. However, my DGV takes several
seconds to "refresh" (I added a "Refresh" button to help me
troubleshoot) to reflect the change even though I immediately call the
"Reload" method following the add:
frmTeam team = new frmTeam(cboSports.Text);
team.ShowDialog();
LoadTeams();
The other interesting point is that I have a similar DELETE button
within the same primary form. The delete simply executes a Delete
Query and then calls the same LoadTeams() method referenced above...
this works great as the next time my DGV is rendered the deleted row
is no longer there.
I have spent numerous hours checking online, but I am sort of at a
loss. I have tried the various .Clear, .Refresh options within both
the DataTable and DataGridView but nothing seems to work.
Any ideas? |