Hi again..yet another question about event handling.
This is my code:
Private Sub Canvas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.fyllDataset()
InitiateWindows()
FormDisplay.Show()
AddHandler DsData1.Kommentar.RowChanged, New DataRowChangeEventHandler(AddressOf Kommentarrow_Changed)
End Sub
Private Shared Sub Kommentarrow_Changed(ByVal sender As Object, ByVal args As DataRowChangeEventArgs)
MsgBox("Event caught")
MsgBox("Event caught")
Canvas.OMG()
End Sub
Friend Shared Sub OMG()
Dim dw As DataView
dw.Table = refhoved.DsData1.Kommentar
dw.RowFilter = "BehandletDato = 'Nei'"
MsgBox(dw.Count.ToString)
End Sub
The problem is as follows. When I do changes to my datagrid which is bound to the dsData1.Kommentar table, the event kicks in and displays the first 2 messageboxes just fine, but when it is supposed to go on to the next line and call the OMG procedure, absolutely nothing happens. The program doesnt hang, but nothing happes as if the code ended with the first 2 msgboxes. I wish to manipulate a listbox on a different mdi child form through this event, but can't seem to get it running
Thanks for reading
This is my code:
Private Sub Canvas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.fyllDataset()
InitiateWindows()
FormDisplay.Show()
AddHandler DsData1.Kommentar.RowChanged, New DataRowChangeEventHandler(AddressOf Kommentarrow_Changed)
End Sub
Private Shared Sub Kommentarrow_Changed(ByVal sender As Object, ByVal args As DataRowChangeEventArgs)
MsgBox("Event caught")
MsgBox("Event caught")
Canvas.OMG()
End Sub
Friend Shared Sub OMG()
Dim dw As DataView
dw.Table = refhoved.DsData1.Kommentar
dw.RowFilter = "BehandletDato = 'Nei'"
MsgBox(dw.Count.ToString)
End Sub
The problem is as follows. When I do changes to my datagrid which is bound to the dsData1.Kommentar table, the event kicks in and displays the first 2 messageboxes just fine, but when it is supposed to go on to the next line and call the OMG procedure, absolutely nothing happens. The program doesnt hang, but nothing happes as if the code ended with the first 2 msgboxes. I wish to manipulate a listbox on a different mdi child form through this event, but can't seem to get it running
Thanks for reading