Error creating custom BO property


Author
Message
Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
I'm getting an error "Object reference not set to an instance of an object." in the FieldPropertyDescriptor code and cannot figure it out.  Maybe a second pair of eyes will help.  I'm pretty sure it is copied straight from the Help.

(This code is in my StaffBO.vb.)

Thanks,

Larry

#Region " Custom Field Properties "

''' <summary>

''' cLastFirst

''' </summary>

''' <remarks></remarks>

<Browsable(False), _

BusinessFieldDisplayInEditor(), _

Description("Staff full name, last name first"), _

DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _

Public ReadOnly Property [CLASTFIRST]() As System.String

Get

Return Me.CLASTNAME & ", " & Me.CFIRSTNAME

End Get

End Property

 

Protected Overrides Function GetCustomBindablePropertyDescriptors() As MicroFour.StrataFrame.Business.FieldPropertyDescriptor()

Return New MicroFour.StrataFrame.Business.FieldPropertyDescriptor() { _

New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor( _

"cLastFirst", GetType(StaffBO))}

End Function

#End Region


Reply
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
OK...first of all, the framework and VB.NET are not necessarily case sensitive, but the core of .NET is regarding a type descriptor.  Anytime that you create a type descriptor, it should always match the name of your custom property...whether you are in a case sensitive language or not, this is ALWAYS the safest thing since there are other core .NET classes that get used within the framework.

Second, how would I add a second custom property descriptor to my StaffBO?

It may be too late, but there is no need to start another thread.  But to do this, just add another item to the array:

Return New MicroFour.StrataFrame.Business.FieldPropertyDescriptor() { _
   New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("cLastFirst", GetType(StaffBO)), _
   New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("MySecondProperty", GetType(StaffBO))}

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