No sorting going on in PerformSelect handler

Posts   
 
    
M6rk
User
Posts: 37
Joined: 29-Sep-2004
# Posted on: 10-Apr-2007 21:57:53   

Hi All,

I am using the LLBLGenProDataSource bound to a TypedView class. I need to sort the values. I added event handler and have set LivePersistance to false.

protected void AvailableTeacherContexts_PerformSelect(object sender, SD.LLBLGen.Pro.ORMSupportClasses.PerformSelectEventArgs e)
{
    e.Sorter.Add(new SortClause(Datalayer.HelperClasses.ViewTeacherContextFields.District,SortOperator.Descending ));
    e.ContainedTypedView.Fill();
}

The event handler is called, but the query (as viewed in trace) does not have an order by clause. The results are not ordered either simple_smile

I suspect stupid user error confused , and would ask you to confirm and identify where i am going wrong.

(Using Jan 17, 2007 build version 2)

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 11-Apr-2007 09:21:35   

You should pass a sortExpression to the Fill method. By handling the PerformSelect yourself, everything should be done manually.

M6rk
User
Posts: 37
Joined: 29-Sep-2004
# Posted on: 11-Apr-2007 14:50:21   

Walaa wrote:

You should pass a sortExpression to the Fill method. By handling the PerformSelect yourself, everything should be done manually.

That works! Thank you!