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

Expection Thrown When Adding a Child Relation to a DataBoundGrid

Thread ID:





22012 Dec 1,2004 01:31 PM UTC Dec 2,2004 12:19 PM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On December 1, 2004 01:31 PM UTC

Using the GridDataBoundGridControl (version under certain conditions in my application, which I can reproduce, I get an excepection when setting up a child relationship: childLevel = myDataBoundGrid.Binder.AddRelation("Children"); System.Reflection.TargetException: Object does not match target type. System.Reflection.TargetInvocationException: Property accessor ''SomeProperty'' on object ''MyObject'' threw the following exception: ''Object does not match target type.'' Where MyObject is an object in my custom collection. SomeProperty is a boolean and always initialised. Most of the time everything works fine. The collection consists of two types of objects, X and Y. Y inherits from X. X has the Children property which returns a collection of X or Y objects. When I receive the exception I''ve checked the collection and everything seems ok, all the objects are of the expected types and initialized. Please could you tell me whether you know what might be causing this or how I can debug it further? Thanks, Ben.

Administrator [Syncfusion]
Replied On December 1, 2004 02:57 PM UTC

The derived objects, one from the other, rings a bell. This problem may be related to the problem discussed in this forum link.

Administrator [Syncfusion]
Replied On December 2, 2004 12:19 PM UTC

Thanks Clay. Used the workaround suggested in this thread and it seems to have fixed it. Best regards, Ben. >The derived objects, one from the other, rings a bell. This problem may be related to the problem discussed in this forum link. > >


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon