| | | StrataFrame 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) |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: 12/09/2008 3:36:08 PM Posts: 2,686, Visits: 1,891 |
| | | | | StrataFrame 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 |
| | | | StrataFrame 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 |
| | | | 
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 |
| | | | StrataFrame 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 |
| | | | 
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 |
| |
|
|