• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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