DomainDataSource with Sort Descending produces reverse order after initial load
-
Tuesday, May 12, 2009 10:00 AM
I have a DataPager control bound to a DomainDataSource that has a SortDescriptor with Direction="Descending". The LoadSize on the DomainDataSource is set to 20. The PageSize on the DataPager is set to 10. I have a DataGrid with ItemsSource bound to the same DomainDataSource as the DataPager. When paging through the DataGrid, pages 1-2 are in correct sort order (descending), but then the remaining pages (3-5) are in ascending order. It seems that once it goes past the rows that were loaded initially due to LoadSize=20, it changes sort direction to Ascending. If I increase the LoadSize to 30 for example, then everything is OK for pages 1-3 and sort goes to descending on pages 4-5. I am using the May 2009 .NET RIA services preview.
All Replies
-
Thursday, May 14, 2009 2:43 PM
I could not repro this. Did you do anything else that might affect the sorting?
-
Thursday, May 14, 2009 3:57 PM
Are you using Entity Framework? if yes, can you add an order by to your query
-
Friday, May 15, 2009 12:32 PM
Not that I'm aware of. I did however, forget to mention that I am using a third party data adapter for the MySQL db connection in the EntityDataModel, so that may be a factor.I could not repro this. Did you do anything else that might affect the sorting?
-
Friday, May 15, 2009 1:08 PM
.
Are you using Entity Framework? if yes, can you add an order by to your query
TFYR. Yes, I am using Entity Framework and a third party db connector for MySQL database. The column I'm ordering descending is the primary key ("id"). Do you think the problem might be with the third party connector? I added an OrderByDescending in the DomainService class but it did not help:
public IQueryable GetJobs()
{
return this.Context.jobs.Include("view_client").OrderByDescending(j => j.id);
}

