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
close icon

Grid not seeing my generic objects properly

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

4 Replies

AD Administrator Syncfusion Team 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


PB Patrick Brunet 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




AD Administrator Syncfusion Team 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.



PB Patrick Brunet 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


Loader.
Live Chat Icon For mobile
Up arrow icon