LLBLGenProDataSource Paging/Sorting issue

Posts   
 
    
ballistik
User
Posts: 23
Joined: 28-Oct-2008
# Posted on: 28-Oct-2008 17:21:16   

I have searched and searched to see if someone else ran into this and did not find anything so here we go... it's probably a simple fix that I am just missing.

FYI: I am using asp.net 3.5 and sql express 2005.

The paging seems to be okay but the sorting is out of whack. Each page sorts correctly the records that it shows, but then page 1 has items that should be on page 2 and vice versa.

I am sorting by ActionDate, Descending and page 1 may have the following dates:

10/28/2008 @ 12:05 PM 10/28/2008 @ 11:23 AM 10/28/2008 @ 11:16 AM 10/28/2008 @ 10:40 AM 10/28/2008 @ 10:03 AM

And page 2 will have these:

10/28/2008 @ 11:44 AM 10/28/2008 @ 11:18 AM 10/28/2008 @ 10:18 AM 10/28/2008 @ 9:46 AM 10/28/2008 @ 9:38 AM

Notice that the items on each page are sorted correctly but the entire collection is not.

I am using an LLBLGenPRoDatasource to bind data to a GridView in asp.net. Here is the markup:


<asp:GridView ID="GridView1" runat="server" DataSourceID="dsActivity"   AllowPaging="true" AutoGenerateColumns="false" PageSize="5" RowStyle-Font-Size="10pt" AlternatingRowStyle-Font-Size="10pt" AlternatingRowStyle-BackColor="AliceBlue" Width="85%" BorderStyle="None" BorderWidth="0" RowStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">

<Columns>
<asp:BoundField DataField="ActionDate" HeaderText="Date" DataFormatString="{0:d} @ {0:t}" SortExpression="ActionDate" />

<asp:BoundField DataField="Action" HeaderText="Activity" ItemStyle-Width="65%" SortExpression="Action" />                   
</Columns>

</asp:GridView>

<llblgenpro:LLBLGenProDataSource runat="server" ID="dsActivity" EnablePaging="true" SortingMode="ServerSide" DataContainerType="EntityCollection"
EntityCollectionTypeName="HappyMondaysDAL.CollectionClasses.ActivityLogCollection, HappyMondaysDAL" LivePersistence="true">
</llblgenpro:LLBLGenProDataSource>

And here is what I call during Page_Load:


//set up the activity datasource...
IPredicateExpression filter = new PredicateExpression();
filter.Add(ActivityLogFields.ChurchId == GetID());
filter.Add(ActivityLogFields.ActionDate >= DateTime.Now.AddDays(-30));
dsActivity.SorterToUse = new SortExpression(new SortClause
                    (ActivityLogFields.ActionDate,  SortOperator.Descending));
dsActivity.FilterToUse = filter;

Any help is appreciated.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 28-Oct-2008 17:56:22   

llblgen pro version? runtime library version/buildnr? Also, use the latest build, as this looks like a bug we fixed some time ago.

Frans Bouma | Lead developer LLBLGen Pro
ballistik
User
Posts: 23
Joined: 28-Oct-2008
# Posted on: 28-Oct-2008 18:04:48   

I'm using version 2.6, runtime v2.0.50727... should I upgrade?

Edit: runtime version is 2.6.8.903... sorry, looked at the .net version accidentally.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 28-Oct-2008 18:07:44   

ballistik wrote:

I'm using version 2.6, runtime v2.0.50727... should I upgrade?

That's the .NET version, please read the GUIDELINES thread in this forum.

Frans Bouma | Lead developer LLBLGen Pro
ballistik
User
Posts: 23
Joined: 28-Oct-2008
# Posted on: 28-Oct-2008 18:23:51   

Sorry about that... see my edit above for the runtime version

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 28-Oct-2008 18:24:23   

That's indeed an older version, please update to the latest build. (available in the customer area)

Frans Bouma | Lead developer LLBLGen Pro
ballistik
User
Posts: 23
Joined: 28-Oct-2008
# Posted on: 28-Oct-2008 18:42:45   

Okay, I installed the latest version (runtime 2.6.8.1013) and regenerated my data layer and still have the same results. Any further thoughts?

ballistik
User
Posts: 23
Joined: 28-Oct-2008
# Posted on: 28-Oct-2008 18:45:05   

Ah I fixed it... while playing around I switched the SortingMode to ClientSide... I noticed that and switched back to ServerSide and we are good to go!

Thanks for the help! smile