Using the GridDataBoundGridControl (version 18.104.22.168) 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?
ADAdministrator Syncfusion Team December 1, 2004 09:57 AM
The derived objects, one from the other, rings a bell. This problem may be related to the problem discussed in this forum link.
ADAdministrator Syncfusion Team December 2, 2004 07:19 AM
Thanks Clay. Used the workaround suggested in this thread and it seems to have fixed it.
>The derived objects, one from the other, rings a bell. This problem may be related to the problem discussed in this forum link.