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

Expection Thrown When Adding a Child Relation to a DataBoundGrid

Using the GridDataBoundGridControl (version 2.1.0.9) 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.

2 Replies

AD Administrator Syncfusion Team 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. http://64.78.18.34/Support/Forums/message.aspx?MessageID=11215


AD Administrator Syncfusion Team 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. > >http://64.78.18.34/Support/Forums/message.aspx?MessageID=11215

Loader.
Live Chat Icon For mobile
Up arrow icon