Solved

Form Updates

Posted on 2006-07-21
6
185 Views
Last Modified: 2010-04-23
I have a form that has a dat grid on it with a lot of information. When you select any row a second form comes up and allows you to make changes to the form. Once they hit updat I would like the data grid on the first form to be updated with the new data. I have the data grid code in a function call and it works fine. Please help.

Thanks
0
Comment
Question by:mwhodges
  • 3
  • 3
6 Comments
 
LVL 17

Expert Comment

by:ZeonFlash
ID: 17155163
When you are opening the "Update" form, how are you passing the row information to the form?  Are you sending the values of the each of the row cells, or are you passing the dataset/datatable/datarow?
0
 

Author Comment

by:mwhodges
ID: 17155181
I am passing the identyfing information and performing another qury he second form because there is more data then on the data grid that I am trying to display here. The first form while large is a summary of sorts.
0
 
LVL 17

Expert Comment

by:ZeonFlash
ID: 17155504
A few more questions:
-Does the update form need to stay open, and by this, does the user need to be able to change something, hit Update, change something, hit Update again, etc?
-Are you looking to refresh the entire grid, or just the row that was updated?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:mwhodges
ID: 17155537
The entire grid would be ok. The 1st form is staying open I am showing the 2nd form in a show dialog.  THey will choose a row in the data grid the 2nd form is shown with all the information in it. They would make their changes hit update and the 2nd form would close and the data grid would be updated.
0
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 400 total points
ID: 17156120
Sounds easy enough :).  Which part are you missing?  

-------------Datagrid Form---------------
    Private Sub DataGrid1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.Click
        dim frmUpdateForm as New UpdateForm(value, value, ...)
        frmUpdateForm.ShowDialog()

        'Upon reaching here, the Update form has been "closed", so refresh the grid
        RefreshDataGrid()
    End Sub

    Private Sub RefreshDataGrid()
      'Code to populate the Datagrid
    End Sub
-------------------------------------------

-------------Update Form---------------
    Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
        'Database update code here

        Me.Hide()
    End Sub
-------------------------------------------
0
 

Author Comment

by:mwhodges
ID: 17156735
Sweet... I didnt know that the showdialog box freezes the code until it regains focus. Thanks a bunch.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now