Link to home
Start Free TrialLog in
Avatar of smickell
smickellFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Close a form and pass data to the form that called it

I have a clock card form that can optionally open a quick-fill form that allows the user to specify a number of criteria, hit 'Fill' and it closes the subform to return to the original. There be an array passed (of some description) from the quick-fill form to the clock card form, this array will be analysed and a number of records created in a DataGridView.

On the original form I have this which launches the quick-fill:
private void btnFillEntries_Click(object sender, EventArgs e)
        {
            formClockCardFiller formCCF = new formClockCardFiller(currentWeek);
            formCCF.WindowState = FormWindowState.Normal;
            formCCF.ShowDialog(this.MdiParent);
        }

How do I fill the DataGridView once the form receives focus from the quick-fill form? This would be easier if I was creating a new form via a constructor, but in my case the calling form is already open. In the subform at OnLoad, do I create a reference to the calling form in some way?
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of smickell

ASKER

Spot on Fernando, many thanks.
No problem, glad I was able to help. ;=)