• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

How do I refresh a data grid from a different form?

Hi,

I'm using ASP.net and VB.  I have form1 and form2. Form2 is opened from Form1.

 I update a table from form2, when I close out of the form2 (by clicking the X in the right hand corner), form1 displays.  How do I get the datagrid on Form1 to refresh so that it shows the updated information (updates to a table made from form2)?

Thanks

0
jm76
Asked:
jm76
1 Solution
 
abbdanCommented:
Before closing form 2 refresh data grid in form 1 with data from form 2.  You should be able to do this on the form close method.
0
 
jm76Author Commented:
can you provide some example code?
0
 
quannvCommented:
Using JavaScript
In form1, you write javascript refreshing function e.g: refreshDg(){}, this is page refresh event.
In Form2 you write like below

<html>
<head>
<script language="javascript">
<!--
function HandleOnClose() {
   if (event.clientY < 0) {
     window.opener.form1.refreshDg;
   }
}
//-->
</script>
</head>
<BODY onbeforeunload="HandleOnClose()">
</body>
<html>
Hop this help
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now