0
votes

I have two forms both with a dgv connected to two different datasets. When i change my data in one of the datasets i have to refresh the other one (i know the solution is not the best). After trying many many different ways of rebinding, refreshing and so i found the following code working:

Private Sub View_Activated(byval sender as Object, _ Byval e as System.Eventargs) Handels MyBase.Activated Table_Load(Nothing, Nothing) End Sub

Private Sub View_Load(byval sender as Object, _ byval e as system.eventargs) Handels Mybase.Load Me.TableAdapter.Fill(Me.Dataset.Table) End Sub

After Chaning things in dgv1 i can see the changes in dgv2 with these commands. BUT when i change mybase.activated to mybase.shown or something else it is not working anymore. Apparently this only works when i use the event activated, but i have no idea why? BTW. I totally dont understand why the dgv is updated with the new data when i have my activated-event but when i comment the activated-event out the dgv is not updated.

1

1 Answers

0
votes

The form's Activated event fires when the form window gets focus. The Load event only fires when the form is initially loaded.

When you make a change on one form, and change focus to the second form, Activated fires.