Do not ignore SorterToUse on llblgenprodatasource2 with LivePersistence="True" SortingMode="ServerSide"

Posts   
1  /  2
 
    
hotchill avatar
hotchill
User
Posts: 180
Joined: 22-Jan-2007
# Posted on: 27-Sep-2013 15:54:08   

I'll try that, but where is the PerformSelect method? I will not get the PerformSelect event from the data source because LivePersistence is on.

protected void RoleDsOnPerformSelect(object sender, PerformSelectEventArgs2 performSelectEventArgs2) {
  while (performSelectEventArgs2.Sorter.Count > 0) {
    performSelectEventArgs2.Sorter.Remove(performSelectEventArgs2.Sorter[0]);
  }
  foreach (ISortClause sortClause in SorterToUse) {
    performSelectEventArgs2.Sorter.Add(sortClause);
  }
}
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39615
Joined: 17-Aug-2003
# Posted on: 27-Sep-2013 23:30:06   

Yes, LivePersistence has to be switched off, unfortunately. It's not a big deal though, in general the method contents of the event handlers are straight forward.

Frans Bouma | Lead developer LLBLGen Pro
hotchill avatar
hotchill
User
Posts: 180
Joined: 22-Jan-2007
# Posted on: 28-Sep-2013 16:17:49   

We have many view-only DataSource/GridView pages with LivePersistence turned off. This is not an issue in that mode because PerformSelect allows us to pass our own filter and sort.

protected void UserDsPerformSelect(object sender, PerformSelectEventArgs2 e) {
  using (var adapter = UnitOfDbWork.DataAccessAdapter) {
    adapter.FetchEntityCollection(e.ContainedCollection, FilterToUse, e.MaxNumberOfItemsToReturn, SorterToUse, e.PrefetchPath, e.PageNumber, e.PageSize);
  }
}

We'll just turn LivePersistence off also for this page then and do our own db CRUD.

1  /  2