473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 7221
"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.