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

binding grid to custom objects with nullable properties

I am binding a generic list of custom objects to a GridGroupingControl. Several of the properties on the custom object have nullable types. When the grid displays, there are two columns showing for each property on the object. For instance, instead of seeing a ProductID column, there is a ProductID_HasValue column and a ProductID_Value column. How can I bind to these objects and still have the columns displayed as they would be if the properties were not nullable. I assume that there might be a way using a CustomTypeDescriptor but have not been able to figure it out. Thanks

NullableGridDemo.zip

1 Reply

AD Administrator Syncfusion Team December 2, 2005 10:00 AM UTC

Thank you for your sample. It looks like Convert.ChangeType in the .NET framework 2.0 does surprisingly not work with Nullable types and will throw an exception once you call it with a nullable type. This is why this particular problem is occurring. Our development team has worked around this problem in our code base, and this correction will be in the upcoming 4.1 release. If you would like access to a intermediate build before the release, submit a direct trac support incident requesting one, and we will try to accomodate you in some manner. I think the 4.1 release will be mid Dec time frame.

Loader.
Live Chat Icon For mobile
Up arrow icon