I have an issue with BindingSource.BindingComplete event; it does not get
raised no matter what I tried. I am kind of wonder if I've been using the
BindingSource class incorrectly.
I created one of this test scenario and put a custom break point in the
BindingComplete event handler to see it it stop there; it never did. Any
help would be greatly appreciated.
Public Class frmTest
Private Sub frmTest_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim MyTestObjectList As New List(Of TestObject)
For i As Integer = 0 To 100
MyTestObjectList.Add(New TestObject(i, CInt(i ^ 2)))
Next
AddHandler MyBindingSource.BindingComplete, _
AddressOf MyBindingSource_BindingComplete
Dim MyBindingSource As New BindingSource
MyBindingSource.DataSource = MyTestObjectList
'datagridviewA is created by drag and frop into the form designer
DataGridViewA.DataSource = MyBindingSource
End Sub
Private Sub MyBindingSource_BindingComplete(ByVal sender As Object, _
ByVal e As
BindingCompleteEventArgs)
'stop here
Stop
End Sub
Private Class TestObject
Private _var1 As Integer
Private _var2 As Integer
Public Sub New(ByVal v1 As Integer, ByVal v2 As Integer)
_var1 = v1
_var2 = v2
End Sub
Public Property Var1() As Integer
Get
Return _var1
End Get
Set(ByVal value As Integer)
_var1 = value
End Set
End Property
Public Property Var2() As Integer
Get
Return _var2
End Get
Set(ByVal value As Integer)
_var2 = value
End Set
End Property
End Class
End Class