S
Shan1986
Guest
Hallo,
I have a class property and i want to bind it to a data table column, i have tried following but can not bind it successfully.
My class
Public SetOfferPrice As New MyClass1
Public Class MyClass1
Implements INotifyPropertyChanged
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Public _SelectedFixedPrice As String
Public Property SelectedFixedPrice() As String
Get
Return _SelectedFixedPrice
End Get
Set(ByVal value As String)
_SelectedFixedPrice = value
PropertyChangedEvent?.Invoke(Me, New PropertyChangedEventArgs(NameOf(SelectedFixedPrice)))
End Set
End Property
End Class
on form load. Here dtRadiObtn is a datatable column and EQ_BS is a binding source of datatable.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim FixedPriceBinding = New Binding(SetOfferPrice.SelectedFixedPrice, EQ_BS, dtRadiObtn)
Me.DataBindings.Add(FixedPriceBinding)
End Sub
it gives me an error on this line "Me.DataBindings.Add(FixedPriceBinding)"
Thanks
Continue reading...
I have a class property and i want to bind it to a data table column, i have tried following but can not bind it successfully.
My class
Public SetOfferPrice As New MyClass1
Public Class MyClass1
Implements INotifyPropertyChanged
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Public _SelectedFixedPrice As String
Public Property SelectedFixedPrice() As String
Get
Return _SelectedFixedPrice
End Get
Set(ByVal value As String)
_SelectedFixedPrice = value
PropertyChangedEvent?.Invoke(Me, New PropertyChangedEventArgs(NameOf(SelectedFixedPrice)))
End Set
End Property
End Class
on form load. Here dtRadiObtn is a datatable column and EQ_BS is a binding source of datatable.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim FixedPriceBinding = New Binding(SetOfferPrice.SelectedFixedPrice, EQ_BS, dtRadiObtn)
Me.DataBindings.Add(FixedPriceBinding)
End Sub
it gives me an error on this line "Me.DataBindings.Add(FixedPriceBinding)"
Thanks
Continue reading...