Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MDI FOrms

Posted on 2004-09-10
7
Medium Priority
?
194 Views
Last Modified: 2010-04-23
I have a menu, which is the parent, and two forms (search, details) which are mdichildren
In search I have a datagrid that displays the results of the search, when you click in any row, it opens details.
In details, I can add, delete, update...But I want to be able to refresh the grid from detail
Any idea?
0
Comment
Question by:Ilianam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 8

Expert Comment

by:wguerram
ID: 12030632
You detail from use the same dataset as your search result form?
0
 

Author Comment

by:Ilianam
ID: 12030645
no
0
 
LVL 8

Expert Comment

by:wguerram
ID: 12030682
How are you actually populating you grid in search results?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Ilianam
ID: 12030704
It's binded to a dataset. Then I keep the contact_id in a public variable and in my detail I execute an sp which has contact_id as a parameter....Then I populate the fields
0
 
LVL 8

Expert Comment

by:wguerram
ID: 12030881
One way would be to make changes to the dataset of your search form from detail form.

But you would have to make double changes.

the other one would be to fill you Dataset throug the DataAdapter, again after you make changes in your detail form.
0
 
LVL 4

Expert Comment

by:Javert93
ID: 12031059
You could use events to let the search form know the details have changed. Define an event in your details form:

    Public Event DetailsModified(ByVal sender As Object, ByVal ContactID As Integer)

Then, wire the event when you create the details form:

    Dim frm As New DetailsForm()
    AddHandler frm.DetailsModified, AddressOf MyDetailsHandler


Finally, you raise the event when the user adds, deletes, or updates:

    RaiseEvent DatailsModified(this, m_intContactID)

As a side note, I would create a constructor in your details form to accept the contact_id rather than storing it in a global variable. With your current setup, you can only have one detail form open at a time without introducing logic errors.
0
 
LVL 8

Accepted Solution

by:
wguerram earned 1000 total points
ID: 12035037
In your detail form you could add a property Named

Public MyTable as DataTable

so when you call your detail form from your search form you could do this.

Dim f as new MyDetailForm

f.MyTable = MyDataSet.Tables(0)
f.ShowDialog

where MyDataSet is the DataSet in you search form.

Now in your Detail form you have complete access to f.MyTable from Search Table.
This way you can keep your data synchronized.

After you close Detail form you can call your DataGrid.Refresh method.
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

722 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