Entities with self-reference make DataGridView refresh continually

Posts   
 
    
JuergenF
User
Posts: 29
Joined: 23-May-2006
# Posted on: 09-Aug-2006 12:37:03   

Hello again

I have a table with a self-reference, eg. (id int, base_id int, description varchar(50)). In the LLBLGen designer I go to 'Fields on related fields' and add description as 'BaseDescription'. Then create SelfServicing code.

If I bind a DataGridView to a collection of these entities and include 'BaseDescription' as a column, the DataGridView begins to flicker (sometimes I have to move the mouse over it to start the flickering). In the debugger I can see that the properties the columns are bound to are continually re-read, so it seems the DGV is in a refresh-loop.

If I don't include the BaseDescription it seems to work normally.

Is there some workaround for this? (besides 'then don't do that' wink )

Thanks Juergen

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 09-Aug-2006 14:20:10   

It seems that you are using SelfServicing, and this might be a LazyLoading effect.

Please try to use prefetchPath to load the related entity (this will disable lazy loading)

JuergenF
User
Posts: 29
Joined: 23-May-2006
# Posted on: 09-Aug-2006 14:46:24   

Please try to use prefetchPath to load the related entity (this will disable lazy loading)

Yes, this works.

Thank you Juergen