Problem with Custom Field Property


Author
Message
Thomas Holste
Thomas Holste
Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi there,

good to see the forum again.

In a BO I created a custom field property (Called "GridName2") according to the helpfile and I use this field via a Businessbindingsource in a DataGridView. So far so good. This property returns, depending on the type of adress (Private or Business) either the firstname or the department.

But when I click on the Column-Header of the DataGridView to sort this field, I get an error message (translated from german)

"Column Gridname2 was not found"

What could I have done wrong?

Thanks in advance

Thomas
Replies
Thomas Holste
Thomas Holste
Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)Advanced StrataFrame User (534 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Trent,

this is what I wrote in the BO:



<Browsable(False), _

BusinessFieldDisplayInEditor(), _

Description("Wahlweise Vorname oder Name2"), _

DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _

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

Get

If Me.ADRESSTYP = "P" Then

Return Me.VORNAME

Else

Return Me.NAME2

End If

End Get

End Property

 

#End Region

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

'Return MyBase.GetCustomBindablePropertyDescriptors()

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

New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor( _

"GRIDNAME2", GetType(KundenBO))}

End Function



I can see no difference?

Thanks a lot and best regards

Thomas
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Thomas.

It looks like the Grid needs the datatable to have the column as of itself.

I created a sample that creates temporary fields on the table with the same name as the custom field, and was able to sort on it. See if it helps.
Attachments
CustomFieldGrid.zip (243 views, 191.00 KB)
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