Results 1 to 2 of 2

Thread: Binding not working on one control

  1. #1

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,388

    Binding not working on one control

    I am having an issue with binding ... basically I have a property ID:

    vb Code:
    1. Dim mc_ID As String
    2.     <System.ComponentModel.Bindable(True)>
    3.     Public Property ID As String
    4.         Get
    5.             Return mc_ID
    6.         End Get
    7.         Set(value As String)
    8.             mc_ID = value
    9.             RaiseEvent PropertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs("ID"))
    10.     End Property

    The property is on a control and that control sets its ID property... triggering the propertychanged event which should update the other bound items...

    The problem is it is not working ... it shows the initial value but any set's don't set the data in the BoundItem!

    This is how I am binding:

    vb Code:
    1. LocationListDrop.DataBindings.Add("ID", BoundItem, "LocationID", True, DataSourceUpdateMode.OnPropertyChanged)

    Also if I go:

    vb Code:
    1. AddHandler LocationListDrop.PropertyChanged, Sub(ss, ee)
    2.         MsgBox(ee.PropertyName & " - " & LocationListDrop.ID)
    3.     End Sub
    The message shows when the property is changed as expected

    Any ideas what's happening?
    Thanks in advance,
    Kris

  2. #2

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,388

    Re: Binding not working on one control

    Ok.. strange.. I changed the property name from id and it started working????

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width