sergey wrote:
Looks like proxies might be at fault here. If you can reproduce this error using a simple self-contained example, please submit a bug report.
I created a single form that performed a QBE search and binded the resulting IList to a DataGridView.
It worked! No errors. No exceptions.
After much tinkering and looking in all the wrong places, I came back to the IList that is returned by QBE. Something had to be wrong there.
It turns out that the objects returned in the IList are not all of the same type. The DataGridView expects all of the objects to be of the same exact type. Here is the type name of each row in my IList::
Code:
?_searchResults[0].GetType().FullName
"CProxyTypePermissionSecurity_INHibernateProxy1"
?_searchResults[1].GetType().FullName
"ChemManager.BusinessObjects.Security.Permission"
?_searchResults[2].GetType().FullName
"CProxyTypePermissionSecurity_INHibernateProxy1"
And yes, the row that is not a Proxy type, that row is throwing exceptions and does not display in the DataGrid.
So, now I have no idea what to do about any of this. I'm not sure why they are not all Proxy objects or they are not all "Permission" objects. What is the difference between a proxy object and my regular BusinessObjects? I thought Proxy had to do with lazy loading, which I'm not intentionally trying to do.
Saving and loading and all other areas of the application work fine.
Any thoughts?
--Brian