Db Int field won't populate in my textbox


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Andria,

The field you are binding to does not have a field property descriptor associated with it which is generally created through the BO Mapper.  I assume you created a custom property and then attempted to bind to that property.  This can be done, but requires a field property descriptor to prevent .NET from using reflection during the binding process.

In the business object 'ChkSourceBO' you will need to add the following code:

Imports
Imports MicroFour.StrataFrame.Business
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports MicroFour.StrataFrame.UI.Windows.Forms

Code Overrides in the ChkSourceBO.vb file
Protected Overrides Function GetCustomBindablePropertyDescriptors() _
     As MicroFour.StrataFrame.Business.FieldPropertyDescriptor()
        Return New FieldPropertyDescriptor() _
         {New ReflectionPropertyDescriptor("3", GetType(ChkSourceBO))}
End Function

There is additional information on this in the help documentation.  You can locate the article at:

Contents -> Business Layer -> Adding Custom Field Properties

Hope this helps. Smile

P.S. This should have nothing to do with the DevExpress textbox and should behave the same way with a standard SF textbox.

Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have a wrapped DevEx textbox on my form, linked to a business object.  This textbox has a BindingField that is an Integer, and it needs to populate on selection of a grid row.  When I try to populate this textbox I get the following exception:

An error occurred while refreshing the data from field 'ChkSourceBO.3' to property 'Text' on control 'fldIncrement.'  Are you missing FieldPropertyDescriptor for a custom property?

I figure this is some kind of conversion or formatting thing trying to go from an integer to a string.  Am I missing anything here?  Why is my field showing as ChkSourceBO.3 when the field is ChkSourceBO.FloatIncr?  The value it's trying to populate is 3...not sure what that's about.  Any ideas?

 

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search