473,805 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7263
"Jeff" <jeff@[_nospam_].hardsoft.com.a uwrote in message
news:00******** **************@ news.astraweb.c om...
>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(Re freshData);

This connects your "RefreshDat a" 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(obj ect sender,
EventArgs e).

Aug 19 '08 #2
Thanks Alberto

Its exactly what I needed
Alberto Poblacion wrote:
"Jeff" <jeff@[_nospam_].hardsoft.com.a uwrote in message
news:00******** **************@ news.astraweb.c om...
>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
automaticall y 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(Re freshData);

This connects your "RefreshDat a" 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(obj ect
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
2039
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 by using Javascript to keep ref to child window and call a moveBy() method on each child window when the parent window.onMove() event. This all works fine, and the effect is like baby windows following the parent window when you move the...
1
2010
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 keeps poping up.. any idea?
4
4259
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 some operation . Once the operation is done, i have to close the child window, and refresh the parent window automatically. I am able to close the child window automatically , But not able to refresh the parent window.
3
1515
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 refreshed/reloaded after Child.html is closed? I don't care if it can be done in HTML, Javascript or PHP, just so it can be done. Is there a way to do this? Mark
1
1741
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 = window.open('http://www.thescripts.com'); how to use "win" to keep refreshing thescript.com Thanks
2
1888
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. * window.opener.document.forms.submit();window.close(); *window.opener.location=window.opener.location; *window.opener.location="http://localhost:8080/sansar/contactHome.htm"; * window.opener.document.location.reload(true);
4
3989
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 the first child window closes after opening the second child. This is the second time I am typing the post, I lost all content because the site complaine I was using the lesser than symbol.
0
2068
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 a dialog box ended up opening up a new browser window with the aspx page, I read on a forum that I should use the iframe control and since I have to open a bunch of pages as diaogboxes, I created a general page(Container.aspx) which has an...
1
9414
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 a dialog box ended up opening up a new browser window with the aspx page, I read on a forum that I should use the iframe control and since I have to open a bunch of pages as diaogboxes, I created a general page(Container.aspx) which has an...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10607
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10359
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10104
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9182
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3843
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.