-
July 21st, 2010, 08:02 PM
#1
Refresh Parent window after closing child window
Hi,
I have a datagridview in the parent window and by clicking on it, a new window pop ups. After closing the child window, I want to refresh the parent window in order to show the changes. I tried to use the 'activate' event and it is not working. Could any one please help me out!
-
July 22nd, 2010, 10:42 AM
#2
Re: Refresh Parent window after closing child window
Are you showing the child window using ShowDialog? If so, after the ShowDialog, run your code that updates your DataGridView. Hopefully you have that code in it's own method so you simply add one line of code here.
===============================
My Blog
-
July 22nd, 2010, 06:10 PM
#3
Re: Refresh Parent window after closing child window
Either what eclipsed said, or handle the child form's Close event.
-
July 22nd, 2010, 06:46 PM
#4
Re: Refresh Parent window after closing child window
A datasource refresh should do once the child window closes. Most likely after the ShowDialog() call. Or you can also pass the parent window to child window and then update it from there. Else, use delegates and then update what you want in the callback function.
-
July 22nd, 2010, 07:13 PM
#5
Re: Refresh Parent window after closing child window
Originally Posted by CuteAssistant
Or you can also pass the parent window to child window and then update it from there.
Please don't do that. It is sloppy programming and there is no good reason to code this way.
-
July 25th, 2010, 07:32 PM
#6
Re: Refresh Parent window after closing child window
Thank you very much to all...It's working well!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|