Sorting on custom fields with LLBLGenDataSource

Posts   
 
    
Elias
User
Posts: 5
Joined: 07-Apr-2006
# Posted on: 23-Jan-2009 18:40:30   

I have an extended entity (ContentCategoryExtendedEntity) whithe the following fields

  • ContentId (physical)
  • CategoryId (physical)
  • LocalizedCategoryName (calculated)
  • ...etc...

How do I sort on LocalizedCategoryName using LLBLGenDataSource (adapter)

i tried this: dsContentCategory.SorterToUse = new SortExpression(new EntityProperty("LocalizedCategoryName") | SortOperator.Ascending);

but with error in casting...

TIA

Elias

Elias
User
Posts: 5
Joined: 07-Apr-2006
# Posted on: 23-Jan-2009 19:19:01   

I solved it after some RTFM by putting SortingMode of datasource to client side.

Copy from manual if everyone is interested: "Server-side sorting only uses EntityField2 objects, so if the entity has a field which isn't a field mapped onto a table/view field, it's ignored in the server-side sorting actions because it's not part of the query send to the database. This is also true for fields mapped onto related fields. In these situations, use client-side sorting."