Does a event exist that solve my problem

T

Tony Johansson

Hello!

I have a form lets call it form 1 which have a DataGrid that show 5 rows
from a database. I then call another form lets call it form 2 that also has
a DataGrid.
In this second form 2 a add a row into the table in the database that form 1
is reading from.
So when I close the second form I want to catch this event in form 1 so I
can do DataAdapter.Fill so the DataGrid
is in match with the table in the database.

I can use a Refresh button in Form 1 that do just that DataAdapter.Fill but
I hope I can do this autmomaticaly
in some way when form 2 is closed.

//Tony
 
A

andy

Hello!

I have a form lets call it form 1 which have a DataGrid that show 5 rows
from a database. I then call another form lets call it form 2 that also has
a DataGrid.
In this second form 2 a add a row into the table in the database that form 1
is reading from.
So when I close the second form I want to catch this event in form 1 so I
can do DataAdapter.Fill so the DataGrid
is in match with the table in the database.

I can use a Refresh button in Form 1 that do just that DataAdapter.Fill but
I hope I can do this autmomaticaly
in some way when form 2 is closed.

//Tony

These two forms are running on the same client?
This is Winforms?
Bit rusty on winforms what with working on WPF for a while.
Can't you bind to one object with both of them?
If you have a datatable or dataset that implements the
notifycollection changed now, doesn't it?
So if you change the collection on one form I would have thought that
would be reflected in the other.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top