StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Custom BO fieldExpand / Collapse
Author
Message
Posted 10/13/2006 1:12:01 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 11/28/2006 3:35:50 PM
Posts: 15, Visits: 17
I added a Custom code to my field for a lookup but now I get an error saying I need a fieldpropertydescriptor. How do I fix this (vb.net project)
Post #3570
Posted 10/13/2006 1:14:21 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 12/09/2008 3:36:08 PM
Posts: 2,686, Visits: 1,891
Sorry, Jon, I'm just too lazy to type it again...

http://forum.strataframe.net/FindPost3479.aspx


www.bungie.net
Post #3572
Posted 10/13/2006 2:41:03 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 11/28/2006 3:35:50 PM
Posts: 15, Visits: 17
Thanks, I saw that before actually. I am just not  sure how to convert that to vb.net

This is what I have so far but it doesnt like boCalc.

Protected Overrides Function GetCustomBindablePropertyDescriptors() As FieldPropertyDescriptor()

Return New ReflectionPropertyDescriptor("Ctr", Type.GetType(boCalc))

End Function

Post #3584
Posted 10/13/2006 2:58:19 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 11/28/2006 3:35:50 PM
Posts: 15, Visits: 17

Okay I figured it out.

 

Protected Overrides Function GetCustomBindablePropertyDescriptors() As FieldPropertyDescriptor()

Return New FieldPropertyDescriptor() {New ReflectionPropertyDescriptor("Ctr", GetType(boCalc))}

End Function

Post #3586
Posted 10/13/2006 4:17:22 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 12/09/2008 3:36:08 PM
Posts: 2,686, Visits: 1,891
Excellent, I'm glad you figured it out.  We usually post everything in VB.NET, but I think the person that that post was answering was a C# guy...

As for the Type.GetType(boCalc), it's a shared (static) method on the System.Type class, and it only accepts strings, but the GetType(boCalc) is a language keyword, so it accepts the type and knows how to compile it.

And you figured out the creating a new array rather than returinging only a single instance.


www.bungie.net
Post #3592
Posted 10/16/2006 8:35:52 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 11/28/2006 3:35:50 PM
Posts: 15, Visits: 17
I tried adding a second custom field to the BO, I am not sure how to add the code to make it work

I tried somthing like this but doesnt work

Protected Overrides Function GetCustomBindablePropertyDescriptors() As FieldPropertyDescriptor()

Return New FieldPropertyDescriptor() {New ReflectionPropertyDescriptor("Ctr", GetType(boCalc))}

Return New FieldPropertyDescriptor() {New ReflectionPropertyDescriptor("Ftr", GetType(boCalc))}

End Function

 

Post #3613
Posted 10/16/2006 8:48:32 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 12/09/2008 3:36:08 PM
Posts: 2,686, Visits: 1,891
Inside the curly braces, just separate the return objects with a comma... it adds them to the array.

This:

New FieldPropertyDescriptor() { }

Tells it to create a new array of type FieldPropertyDescriptor.  Whatever you put in the curly braces are items in the newly created array (ReflectionPropertyDescriptor is a subclass of FieldPropertyDescriptor).  So, it needs to look like this:

Return New FieldPropertyDescriptor() { New ReflectionPropertyDescriptor("Ctr", GetType(boCalc)), _
    New ReflectionPropertyDescriptor("Ftr", GetType(boCalc)) }

Any others that you add just need to be separated by commas.


www.bungie.net
Post #3616
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 6:52pm

Powered by InstantForum.NET v4.1.4 © 2009
Execution: 0.141. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.