472,960 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,960 software developers and data experts.

Refreshing Parent window from child window

I have a Form parent window with a list view on it.
When I click on an item I open another form to edit the details - this
is not and cannot be a dialog window.

When I close the child window I would like the parent window to
automatically refresh by calling a method RefreshData().

How can I achieve this.

Regards
Jeff
Aug 19 '08 #1
2 7148
"Jeff" <jeff@[_nospam_].hardsoft.com.auwrote in message
news:00**********************@news.astraweb.com...
>I have a Form parent window with a list view on it.
When I click on an item I open another form to edit the details - this is
not and cannot be a dialog window.

When I close the child window I would like the parent window to
automatically refresh by calling a method RefreshData().

How can I achieve this.
In the parent form you are probably opening the child form in a way
similar to this:

MyEditForm frm = new MyEditForm();
frm.Show();

In between those lines, you can add an event handler to the form:

frm.Closed += new EventHandler(RefreshData);

This connects your "RefreshData" routine to the Closed event of the
form, so when the form is closed your method will be called as you wanted.
Note that for this to compile, the RefreshData method needs to have the
proper signature for an EventHandler, i.e. void RefreshData(object sender,
EventArgs e).

Aug 19 '08 #2
Thanks Alberto

Its exactly what I needed
Alberto Poblacion wrote:
"Jeff" <jeff@[_nospam_].hardsoft.com.auwrote in message
news:00**********************@news.astraweb.com...
>I have a Form parent window with a list view on it.
When I click on an item I open another form to edit the details - this
is not and cannot be a dialog window.

When I close the child window I would like the parent window to
automatically refresh by calling a method RefreshData().

How can I achieve this.

In the parent form you are probably opening the child form in a way
similar to this:

MyEditForm frm = new MyEditForm();
frm.Show();

In between those lines, you can add an event handler to the form:

frm.Closed += new EventHandler(RefreshData);

This connects your "RefreshData" routine to the Closed event of the
form, so when the form is closed your method will be called as you wanted.
Note that for this to compile, the RefreshData method needs to have
the proper signature for an EventHandler, i.e. void RefreshData(object
sender, EventArgs e).
Aug 19 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vijay Kumar | last post by:
Hello all I have a window (call it the parent window) that when moved makes any children windows (windows that were opened by this window) move by the same distance in X & Y direction. I do this...
1
by: Pikolo Mondo | last post by:
hello, i've got a child window which will refresh the parent window after it closes heres the catch, if i use window.open() it works fine, but when i use window.showModelessDialog, the child window...
4
by: Sileesh | last post by:
Hi I have a btn in Parent.aspx page . On server_click() of the Btn, i am opening a new window called the child.apsx window. Child window also have a Btn. On serverClick of this Btn, I perform...
3
by: Mark | last post by:
I have a link on Parent.html which brings up Child.html in a separate browser window. Child.html has a button with Javascript to close itself. Is there a way I can cause Parent.html to be...
1
by: hashya | last post by:
Hi, I am opening window(child) from current window(parent). Now I want to keep refreshing child window from parent window. How can I achieve this. e.g. var win =...
2
by: gsuns82 | last post by:
hi all,I want to reload the parent window from the child Window in mozilla fire fox browser,i tried these following stuffs by calling events in onunload in child Window. *...
4
by: Buddha | last post by:
Hello, I posted this on two forums, without too much help .. and I am kinda stuck in this. I need to refresh the parent page from the second child window which is opened by the first child and...
0
by: Bali | last post by:
Default.aspx is the starting page containing a control(ascx) which has asp:button control on it. On the button click event it has to open a new page as a modal control. Since refreshing a page in...
1
by: Bali | last post by:
Default.aspx is the starting page containing a control(ascx) which has asp:button control on it. On the button click event it has to open a new page as a modal control. Since refreshing a page in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.