Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > BindingSource.BindingComplete Event does not get raised
 

BindingSource.BindingComplete Event does not get raised

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
  • Moved byeryangMSFTMonday, September 14, 2009 2:31 AM (From:.NET Base Class Library)
  •  
Frank Do  Friday, September 11, 2009 4:18 PM

Hi,

Seems the BindingComplete event only works for simple databinding.

Which function do you want to implement?

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Friday, September 18, 2009 1:21 PM
I want to find out when the binding between my datasource (the actual datasource such as business object or dataset) and the bindingsource is completed (NOT between the binding source and datagridview).

What do you meant by simple databinding? Can you give me an example of a scenario where it works and where it does not work. Look at the description of DataSource.BindingComplete event; is the description wrong?
Frank Do  Monday, September 21, 2009 3:27 PM

You can use google to search for other answers

Custom Search

More Threads

• How to detect when a tab page is being selected?
• New Row
• How to let DataGridView always show the new row?
• Typed Dataset and Query
• FillByParameter - using parameters with the Select Statement
• Bind SQL RETURN to textbox
• download files from server in c#
• Using SqlCeResultSet to insert and it doesnt insert (no errors)
• how to set unique row values for specific columns
• How to change the DataSet Designer