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.
Syncfusion Feedback

Expection Thrown When Adding a Child Relation to a DataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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.

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

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

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.

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

;