Loading generic/dynamic list result to lLLBLGenProDataSource2

Posts   
 
    
Agsy
User
Posts: 5
Joined: 03-Dec-2008
# Posted on: 30-Dec-2008 06:47:38   

Help someone!

Not sure if this is already been asked before...but I'll give it a crack anyway since I am already running out of ammo in my little brain. cry

How do I load generic or dynamic list (created using custom class) results into a LLBLGenProDataSource2?

The entire purpose is to avoid handling paging and sorting features in my gridview control. As you might have guessed after loading the result of the doing "PROJECTION" into a generic list I had a problem handling paging in my gridview control and the only way I could think of not handling paging in my codes is to load it in LLBLGenDataSource2 data control.

I am currently using the LLBLGEN version 2.6 FINAL running under .NET 3.5.

Thanks much.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 30-Dec-2008 10:45:26   

LLBLGenProDataSource can only load an EntityCollection, a TypedList or TypedView.

So if the DynamicList has fields from one entity, you may project the resultset into an EntityCollection and use an LLBLGenProDataSource without LivePersistance to set the EntityCollection manually.

Otherwise you are on your own.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 30-Dec-2008 11:07:19   

Paging on a dynamic list is something you've to do yourself, but it's not that hard: bind an event handler to the grid's event which is raised when the user clicks on a page number in the pager control.

There, you fetch the new page using the routine which fetches your dynamic list and bind that directly to the grid. So the code you've to write is not that much, typically the normal event handler stuff and the call to the fetch routine you've written.

Frans Bouma | Lead developer LLBLGen Pro
Agsy
User
Posts: 5
Joined: 03-Dec-2008
# Posted on: 30-Dec-2008 12:41:19   

Thanks Guys for the ideas. I'll give each one a try.

Have a good one! wink