EntityCollection based on a view will not bind to DataGridView

Posts   
 
    
Posts: 77
Joined: 05-May-2005
# Posted on: 11-Aug-2020 15:33:39   

I have a view which I reverse-engineered to an Entity Definition in the LLBLGen designer. Team members are used to using filters, sorters, etc. for entity collections, so to keep things consitent, we've always mapped views to entity definitions and have never used TypedViews. It's never been a problem until yesterday when I fetched an EntityCollection of that entity that represents a view and it took about 5 minutes to bind 604 rows to a datagridview. And when it finally displayed, it had the correct number of rows, but no data in the cells. I realized that we have never done anything more with these view entities except fetch them; no binding. I reverse-engineered the view to a TypedView in the designer, used the query factory to fetch the rows in the code, and now it works perfectly. But I'm curious as to why the entity collection of an entity representing a view fails so miserably. Is this by design?

LLBLGen version: 5.5.7 Build date 25-May-2020 ORMSupportClasses: 5.5.7 Database: Oracle 12g ODP.NET client

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 11-Aug-2020 19:11:24   

It should work OK, the entities in the entity collection are filled with data? 5 minutes an awful long time tho.

Binding to a winforms grid/gridview (aka complex databinding) of entity instances is done through the entitycollection's DefaultView, but this works OK for entities in our tests, so I don't know what might be wrong. It has nothing to do with whether the target is a table or a view, that's not important for the entity instance in memory.

Do you do anything special in the datagridview? You create the columns dynamically or up front (and do the types and field names match with the property names of an entity instance? ) And lastly: did you use a bindingsource to bind the entity collection?

Frans Bouma | Lead developer LLBLGen Pro