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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid not seeing my generic objects properly

Thread ID:

Created:

Updated:

Platform:

Replies:

74136 May 30,2008 07:58 PM UTC Jun 10,2008 03:40 PM UTC WinForms 4
loading
Tags: GridControl
Patrick Brunet
Asked On May 30, 2008 07:58 PM UTC

Hi,

I have a generic business list which contains generic business objects and i am using the list to bind to a column in a Grid Control.

The column is marked as "ComboBox" in the cell type property, I pass the list to the DataSource property, "Id" as the ValueMember and "Description" as the DisplayMember. As the image shows, the grid does not seem to be capable of getting the "Description" property because it cannot drill down into the actual object as the .Net debugger shows.

I have no problem when binding a normal windows dropdown control.

Thanks in advance for your help,

Patrick



GridControlBizObject_3add62bf.zip

Administrator [Syncfusion]
Replied On May 31, 2008 12:37 AM UTC

What kind of list are you setting as the datasource? Here is a sample this works for List (and BindingList). Now, it will not recurse through complex poperties if that is what you are trying to do. That is not currently supported.



GC_Combo_20dfc510.zip

Patrick Brunet
Replied On June 2, 2008 02:39 PM UTC

Thanks Clay...

I used your sample and modified it to the way our list/objects works and found out the problem comes primarily from our list objects. Our list objects uses the CLSA framework (http://www.lhotka.net/cslanet/) and as soon as i change your sample to use these lists, the original problem re-occurs.

Have you had any experience using generic lists using the CSLA framework?

Thanks,

Patrick

>What kind of list are you setting as the datasource? Here is a sample this works for List (and BindingList). Now, it will not recurse through complex poperties if that is what you are trying to do. That is not currently supported.



GC_Combo_20dfc510.zip



Administrator [Syncfusion]
Replied On June 3, 2008 06:48 PM UTC

There are a few users using this library but evidently they are not using it in the same way as you as we have not had this particular problem pop up with them.

One potential way you can manage this is to add a wrapper class for your lists that implements ITypedList. In the GetItemProperties, you could pass back property descriptors that pick out exactly the values you want exposed. The grid should then see these exposed items without any problems. It would take a little coding to handle this.


Patrick Brunet
Replied On June 10, 2008 03:40 PM UTC

Thanks for the reply. After further testing, we were able to find out my the grid does not see the properties. The generic list is declared as such to initialize the generic object that it will have in it's list. But we declare it using an interface. The interface has the primary properties on it such as Id, IsDirty, etc and the grid cannot cast this interface into the real object, it only knows about the properties on the interface. What we was to add a function in the base class where it will return the objects in a generic List object of the interface and it solved the problem.

Pat


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;