Is it possible to create a custom field in a BO, that is not part of the underlying DataSource, that I can bind to? I tried adding the following custom field to my BO.
Private mVerifyPassword As String = ""
<Browsable(False), _
BusinessFieldDisplayInEditor(), _
Description("Verify Password"), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
Public Property UserCF_VerifyPassword() As System.String
Get
Return mVerifyPassword
End Get
Set(ByVal value As System.String)
If mVerifyPassword = value.Trim Then Exit Property
mVerifyPassword = value.Trim
Me.OnFieldPropertyChanged(Me, _
New UserFieldChangedEventArgsmVerifyPassword))
End Set
End Property
I can bind to it in the designer but when I go to run the program I get the following error:
BusinessLayerException
An error occurred while refreshing the data from field 'UserBO.UserCF_VerifyPassword' to property 'Text' on control 'txtVerifyPassword.' Are you missing FieldPropertyDescriptor for a custom property?
ArgumentException
Cannot bind to the property or column UserCF_VerifyPassword on the DataSource.
Parameter name: dataMember
Source : MicroFour StrataFrame Business
Stack Trace:
at System.Windows.Forms.BindToObject.CheckBinding()
at System.Windows.Forms.BindToObject.SetBindingManagerBase(BindingManagerBase lManager)
at System.Windows.Forms.Binding.SetListManager(BindingManagerBase bindingManagerBase)
at System.Windows.Forms.ListManagerBindingsCollection.AddCore(Binding dataBinding)
at System.Windows.Forms.BindingsCollection.Add(Binding binding) ...
-Larry