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

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


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)?


1 Solution
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.
jm76Author Commented:
can you provide some example code?
Using JavaScript
In form1, you write javascript refreshing function e.g: refreshDg(){}, this is page refresh event.
In Form2 you write like below

<script language="javascript">
function HandleOnClose() {
   if (event.clientY < 0) {
<BODY onbeforeunload="HandleOnClose()">
Hop this help
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