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.
Unfortunately, activation email could not send to your email. Please try again.

binding grid to custom objects with nullable properties

Thread ID:

Created:

Updated:

Platform:

Replies:

37908 Dec 1,2005 05:56 PM Dec 2,2005 05:00 AM Windows Forms 1
loading
Tags: GridControl
David Woodstrom
Asked On December 1, 2005 05:56 PM

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

Administrator [Syncfusion]
Replied On December 2, 2005 05:00 AM

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.

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.

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.

;