Avatar of smickell
smickell
Flag 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?
C#

Avatar of undefined
Last Comment
Fernando Soto

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Fernando Soto

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
smickell

ASKER
Spot on Fernando, many thanks.
Fernando Soto

No problem, glad I was able to help. ;=)
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck