StrataFrame Forum

BBS does not show Custom Field (CFP)

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

By Luiz Lima - 2/17/2010

Hi,



I created some CFPs but they don´t appears on my selection field when I use a BBS with DevExpress Grid.



Anybody can help me?



Tks
By Trent L. Taylor - 2/18/2010

Most likely you did not add them to the GetCustomBindablePropertyDescriptors. You need to override this method and add the ReflectionPropertyDescriptors for each CFP.



You can see samples of this in a lost of different SF samples. The best, however, would be the StrataFlix sample.
By Luiz Lima - 2/18/2010

Trent,



I don´t have strataflix here, I tried to find this property on VB Samples, but I didn´t.Sad

Can you help me with the example below?

If this CFP appears on Grid, We will solve a huge problem on my development.



Tks a lot again,



Luiz

--------------------------------------------------------------------------------------------------------

_

Public ReadOnly Property [CFP_pro_descr]()

Get

Dim loCommand As New SqlCommand()

loCommand.CommandText = "SELECT pro_descr FROM tb_produto WHERE pro_cod = @pro_cod"

loCommand.Parameters.Add("@pro_cod", SqlDbType.VarChar)

loCommand.Parameters("@pro_cod").Value = Me.pro_cod

Return CType(Me.ExecuteScalar(loCommand), String)

End Get

End Property

--------------------------------------------------------------------------------------------------------
By Luiz Lima - 2/18/2010

Ops...the code was cutted.





_

Public ReadOnly Property [CFP_pro_descr]()

Get

Dim loCommand As New SqlCommand()

loCommand.CommandText = "SELECT pro_descr FROM tb_produto WHERE pro_cod = @pro_cod"

loCommand.Parameters.Add("@pro_cod", SqlDbType.VarChar)

loCommand.Parameters("@pro_cod").Value = Me.pro_cod

Return CType(Me.ExecuteScalar(loCommand), String)

End Get

End Property


By Edhy Rijo - 2/18/2010

Hi Luiz,



Here is a sample in VB, make sure you use your BO name in the GetType():





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

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

New ReflectionPropertyDescriptor("cfp_pro_descr", GetType(Here use the name of your bo))}

End Function

By Luiz Lima - 2/18/2010

Edhy,



In which point of file should I put this lines to garantee that BOM will not kill my codes?



tks
By Edhy Rijo - 2/18/2010

Hi Luiz,



Put it anywhere in your BO it is just another function. Make sure you re-build your BO project or the whole solution to make sure it will be seen by the BBS.
By Trent L. Taylor - 2/18/2010

Edhy is putting you on the right track here...but you can download StrataFlix by just logging into the My Account area of the SF website and going to the downloads section.
By Luiz Lima - 2/18/2010

Edhy,



It didn´t work!

I made a clean / rebuild and nothing!

Could you see my BO code to see if I´m doing something wrong?



I attached a file with:



- ScreenShot of Devexpress grid configuration

- My BO



Tks
By Edhy Rijo - 2/18/2010

Luiz,



Could it be because you have the name of the property enclosed with brackets [] in the GetCustomBindablePropertyDescriptors?



Just copy the one I did for you above, it should work. Rebuild the solution before testing.



If that does not work, close the solution and VS then open it again, build and try.
By Luiz Lima - 2/18/2010

Edhy,



It works now!

But I had to remove the grid, bbs and bo from form, after that Works.



A doubt: If my grid does not change this column (CFP), no matter with the BO Update?



Tks
By Edhy Rijo - 2/18/2010

Luiz Lima (02/18/2010)
A doubt: If my grid does not change this column (CFP), no matter with the BO Update?




Glad it is working now.



As far as update, remember that the Custom Field Property is read only so you will not be able to change it or update it, so in your grid make sure it is shown as read only.
By Luiz Lima - 2/19/2010

Pretty Cool...

Tks a lot again....Cool

By Trent L. Taylor - 2/19/2010

Glad you got it going! Smile
By Luiz Lima - 2/19/2010

Trent,

Thank you so much for your help and the guys of this forum.
I´m not a advanced programmer on .NET/VS Platform, I came from old fashion client-server technology.

I´m learning a little piece of stuffs every day......
I told to Ivan that I can feel more secure to do a testimonial about SF right now, If you wanna.... ask me by email ok?

See ya! Cool

By Ivan George Borges - 2/19/2010

Hey Luiz!

Oh, yeah... go ahead! It is always welcome. Wink