Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:33:00+00:00 2026-06-03T10:33:00+00:00

Can a data grid in another open form be refreshed by calling a sub

  • 0

Can a data grid in another open form be refreshed by calling a sub routine?

This app has a form with 2 data grids. When the user double click on one of the grids another form is opened that shows data details. After the user changes the details the user clicks a save button.

We have placed this code in the Closing event of the the details form.

Private Sub FormParents_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing

    FormParentsAndStudents.RefreshDataGrids()
End Sub

The code does execute because we placed a msgbox in there to test it.

Here is the code we are trying to use to refresh the data grids. It’s in the form with the 2 data grids:

Public Sub RefreshDataGrids()

    Me.ParentsTableAdapter.Fill(Me.DataSetParentsStudents.Parents)
    Me.StudentsTableAdapter.Fill(Me.DataSetParentsStudents.Students)
    LightGridParents.Refresh()
    LightGridStudents.Refresh()
End Sub

Can you tell us what additional coding is needed to refresh this data or if we are using the incorrect place to call this code from within the details form?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:33:02+00:00Added an answer on June 3, 2026 at 10:33 am

    I found a way to do it and hope it helps other people.

    I removed the call from the details form that refreshed the data grids.

    Instead, I call the form as a dialog window when the user double clicks to get the details form. I placed coding after the call to the dialog form to re-fill the table adapter and that did the trick.

    Here is the coding:

    ' Control handlers - Grid handlers.
    '----------------------------------
    Private Sub LightGrid_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LightGridParents.MouseDoubleClick
    
        If ParentsBindingSource.Count > 0 Then
    
            ' Call the parents form.
            '-----------------------
            objFormParents = New FormParents(IDTextBox.Text, "From Parents And Students")
            objFormParents.ShowDialog()
    
            ' Refresh the data grid.
            '-----------------------
            Me.ParentsTableAdapter.Fill(Me.DataSetParentsStudents.Parents)
        End If
    End Sub
    
    Private Sub LightGridStudents_MouseDoubleClick(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles LightGridStudents.MouseDoubleClick
    
        If StudentsBindingSource.Count > 0 Then
    
            ' Call the students form.
            '------------------------
            objFormStudents = New FormStudents(StudentsIDTextBox.Text, "From Parents And Students")
            objFormStudents.ShowDialog()
    
            ' Refresh the data grid.
            '-----------------------
            Me.StudentsTableAdapter.Fill(Me.DataSetParentsStudents.Students)
        End If
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can you advice me good php ajax and mysql data grid. It is supposed
How a particular cell can be filled with any color in advanced data grid.
I have local data in a grid. How can I get all of the
I have a data grid view in one windows form named GridViewForm. When the
I am trying to design a form where the user can search records to
Initially I am populating 100 rows in Data grid, when user scroll the grid
I have created a data grid in WPF and have 2 lists. I want
I hope someone can help me..... i am trying to build a dynamic form
I have a list of lists that represent a grid of data (think rows
Hi i have application where i have to export grid data on a page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.