B
BD
I have an MDI application with a datagridview on a childform1 that
will open childform2 with a double-click event on childform1.
Childform2 works on a record and upon closing I want the datagridview
on childform1 to update to reflect the changes. Currently, I close
childform1 forcing the user to reopen it to reflect the changes. I
have coded a method on childform1 to reload the table adapter but have
been unable to access it from childform2. The following code below is
a brief coding:
childform1:
public void DGVReload()
{
this.childform1tableadapter.fill(this.dataset.childform1);
}
childform2:
private void btnSave_Click(object sender, EventArgs e)
{
childform1.DGVReload();
}
Program will not compile and returns the following error code:
An object reference is required for the nonstatic field, method, or
property
I know there is a simple solution, but I honestly have not been
successful. Any help or direction is appreciated.
BDW
will open childform2 with a double-click event on childform1.
Childform2 works on a record and upon closing I want the datagridview
on childform1 to update to reflect the changes. Currently, I close
childform1 forcing the user to reopen it to reflect the changes. I
have coded a method on childform1 to reload the table adapter but have
been unable to access it from childform2. The following code below is
a brief coding:
childform1:
public void DGVReload()
{
this.childform1tableadapter.fill(this.dataset.childform1);
}
childform2:
private void btnSave_Click(object sender, EventArgs e)
{
childform1.DGVReload();
}
Program will not compile and returns the following error code:
An object reference is required for the nonstatic field, method, or
property
I know there is a simple solution, but I honestly have not been
successful. Any help or direction is appreciated.
BDW