Hi,
I have a form w/ three DataGridViews (dgvInterivews, dgvDemarcationSets & dgvCodingSets), all related in a parent-child-grandchild kind of relationship. There are three BindingSources providing the data sources. All works great.
A button on the form (actually a button contained in a user control on the form)fires offa database update which adds a record to the middle DataGridView, dgvDemarcationSets. I want dgvDemarcationSets to refresh itself and show the new row.
The user control whch contains the button, called ucButtons, raises an event which is handled by the containing form.I can see that this is happening properly, but DataGridView is not refreshing. Here is the code on the containing form:
<pre lang="x-c#">void ucButtons_ButtonClickEvent(object sender, EventArgs e)
{
WriteLog("dlgBrowseInterviews", "ucButtons_ButtonClickEvent", true, true);
bsInterviews.ResetBindings(false);
bsDemarcationSets.ResetBindings(false);
bsCodingSets.ResetBindings(false);
// dgvInterviews.Refresh();
// dgvDemarcationSets.Refresh();
// dgvCodingSets.Refresh();
// this.Refresh();
}
The log entry from theWriteLog line confirms that this event handler is getting called. According to the VS2008 documentation, calling ResetBindings on the BindingSource should automatically refresh all the controls which use that BindingSource as the DataSource. The commented lines weresuggestions from other posts,which did nothing.
Any suggestions?
Thanks.
Dan
Dan Hurwitz