We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

BindingList with customized PropertyDescriptor

Using 5.1

I have a collection of business objects, implementing IBindingList and ITypedList

The GetItemProperties method returns a collection of "extended" PropertyDescriptor, meaning it contains custom cell renderer and formatter.

I would like to find out how after binding the collection to the grid, the grid can "figure out" from the provided "Extended" PropertyDescriptor to set up and use the renderer and formatter

Thanks for your help

3 Replies

GR Golda Rebecal Syncfusion Team September 8, 2007 07:06 AM UTC

Hi Sean,

You can achieve your requirement by iterating through the columns collection of the TableDescriptor and applying custom style specified in the extended PropertyDescriptor programmatically.

You can use the following code to get the PropertyDescriptor of a column:
gridGroupingControl.TableDescriptor.Columns[0].FieldDescriptor.GetPropertyDescriptor()

You can set the custom style to the columns using the Appearance property of the column (gridGroupingControl.TableDescriptor.Columns[0].Appearance)

Please try this and let me know if this helps you.

Best regards,
Golda


SE Sean September 13, 2007 10:43 PM UTC

Actually I was thinking of creating a custom cell renderer and attach to the column descriptor. It seems GridControl can do that but GridGroupingControl can't.

Basically I want to create a whole bunch of independent renderer, and attach to each column descriptor when needed.

For example, I want to create a country flag renderer. When I attach it to a column it would render based on the content of the cell. If the cell has US, then a US flag will appear

Thanks


GR Golda Rebecal Syncfusion Team September 17, 2007 11:23 AM UTC

Hi Sean,

Sorry for the delay in responding.

Could you please provide a sample that uses custom ColumnDescriptor in GridGroupingControl or atleast a sample that works with GridControl so that we can work in depth and provide you a solution?

Best regards,
Golda

Loader.
Live Chat Icon For mobile
Up arrow icon