StrataFrame Forum

GetCustomBindablePropertyDescriptors

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

By Doug Birtell - 9/4/2007

I am attempting to create a custom field on a BO that consists of 2 columns, the persons first name and the persons last name.

I have created the custom field property as...

/// <summary>

/// FirstAndLastName

/// </summary>

/// <remarks></remarks>

[Browsable(false),

BusinessFieldDisplayInEditor(),

Description("FirstAndLastName"),

DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

public System.String FirstAndLastName

{

get

{

return (System.String)this.CurrentRow["FirstName"] + " " + (System.String)this.CurrentRow["LastName"];

}

}

But, I'm having issues with creating the discriptor.  The problem is that when I run the form, I get a null reference exception.  The code I'm using (straight from other examples) appears to be missing something...

protected override FieldPropertyDescriptor[] GetCustomBindablePropertyDescriptors()

{

return new FieldPropertyDescriptor[] { new ReflectionPropertyDescriptor("cust_fullname", GetType()) };

}

The problem appears to be in the GetType method.

Any ideas?  I know this has to be a simple one.

Thanks,

Doug

By Doug Birtell - 9/4/2007

Never mind.

I'm an idiot.

By Trent L. Taylor - 9/4/2007

LOL....not at all...I figured you would see it pretty quick...and I was right BigGrin
By StrataFrame Team - 9/5/2007

Yep, syntax is different for C#... typeof(Type), not GetType(Type).