Binding a grid to an entitycollection

Posts   
 
    
Mathieu
User
Posts: 4
Joined: 05-Mar-2006
# Posted on: 05-Mar-2006 23:41:17   

Hi all,

i currently have a little performance problem when binding a entity collection to any kind of grid in winforms coding. I think the main problem is that i'm using fields on related fields in my entity collection. When i'm binding a collection to a grid that contains fields on related fields it takes quite a while to even show the grid.

Does anyone have some recommendations for using grids in winform programming?

Thanks in advance!

Mathieu

Mathieu
User
Posts: 4
Joined: 05-Mar-2006
# Posted on: 05-Mar-2006 23:46:56   

It is, of course, binding an entity collection to a grid smile

Mathieu
User
Posts: 4
Joined: 05-Mar-2006
# Posted on: 06-Mar-2006 10:29:36   

Hi all,

the thread about binding a entity collection to a grid in winforms coding is set to not active / completed, although my question hasn't been answered.

Could someone please advise me concerning the use of grids and binding entity collections to it in winforms programming? I'm still having the problem that when i'm using an entity collection which contains fields on related fields to bind to a grid, it takes very loooong time to show the grid.

Thanks in advance!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 06-Mar-2006 12:23:14   

My bad, I thought you answered your own question (and I didn't read your first question in depth). It's unmarked now.

Frans Bouma | Lead developer LLBLGen Pro
Mathieu
User
Posts: 4
Joined: 05-Mar-2006
# Posted on: 06-Mar-2006 15:22:41   

That's no problem at all, but haven't you got some recommendations / experiences with my problem?

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 06-Mar-2006 18:06:07   

I'll be happy to try to help. Can you give a little more information as to what exactly the problem is? And which grid are you using?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 06-Mar-2006 18:36:03   

Mathieu wrote:

Hi all,

the thread about binding a entity collection to a grid in winforms coding is set to not active / completed, although my question hasn't been answered.

Could someone please advise me concerning the use of grids and binding entity collections to it in winforms programming? I'm still having the problem that when i'm using an entity collection which contains fields on related fields to bind to a grid, it takes very loooong time to show the grid.

Thanks in advance!

The problem with the fact that it takes a LOOOOOOOONG period of time, is because the grid triggers lazy loading (I pressume you're using selfservicing). Say you have 100 order objects and in the order a field called CompanyName and that's mapped on Order.Customer.Companyname. For each row, the grid will read that field, which triggers the lazy load routine to load just that entity, so for each of the 100 order objects, a query is used.

Instead, prefetch the related entities using a prefetch path. This is much more efficient.

Frans Bouma | Lead developer LLBLGen Pro