I have parent form and child form. Parent form contains a dataGridView (list of accounts) and the child form allows a user to register an account.
The child form is launched on a separate thread.
When the account is registered, it’s added to the SQL database and event is fired on the child form which the parent form subscribes to. The parent form then updates the dataGridView to add the new value from the database.
The problem is when trying to update the dataGridView in the parent form upon the event being fired I get a cross thread error. Is this normal behaviour in this context?
In your handler you will have to do some work to bring the handler back on the UI thread… The “norm” is to using
InvokeRequiredandBeginInvokethe following pattern: