This question is locked. New answers and comments are not allowed.
I was using 2009 3 1103. I just upgraded to 2009 3 1208. Now I get error 4004 InvalidCastException.
I have a grid that is bound to a List<DemographicData> but it actually contains several types of objects whose base class is DemographicsData.
For example:
BaseData
DemographicData derived from BaseData
PersonalDemographicData derived from DemographicData
EmployerDemographicData derived from DemographicData
FamilyDemographicData derived from DemographicData
List<DemographicData> has PersonalDemographicData, EmployerDemographicData , and FamilyDemographicData
Calling "grid.DataContext = demographicdata" now crashes with 4004.
If the List only contains objects of one type (Personal, Employer, or Family) then it works fine. But if you have 2 or more types, it breaks.
The grid has AutoGenerateColumns="False" and the only 2 columns in the grid that are bound are bound to properties of BaseData.
Any ideas?
Looks like the grid is assuming that the object types of all entries must be the same.
I have a grid that is bound to a List<DemographicData> but it actually contains several types of objects whose base class is DemographicsData.
For example:
BaseData
DemographicData derived from BaseData
PersonalDemographicData derived from DemographicData
EmployerDemographicData derived from DemographicData
FamilyDemographicData derived from DemographicData
List<DemographicData> has PersonalDemographicData, EmployerDemographicData , and FamilyDemographicData
Calling "grid.DataContext = demographicdata" now crashes with 4004.
If the List only contains objects of one type (Personal, Employer, or Family) then it works fine. But if you have 2 or more types, it breaks.
The grid has AutoGenerateColumns="False" and the only 2 columns in the grid that are bound are bound to properties of BaseData.
Any ideas?
Looks like the grid is assuming that the object types of all entries must be the same.