Sorting when column header is clicked is not working correctly

Posts   
 
    
pdm25
User
Posts: 8
Joined: 04-Feb-2008
# Posted on: 18-Feb-2008 10:35:53   

LLBLGen Pro: 2.5 final SD.LLBLGen.Pro.ORMSupportClasses.NETxy.dll: 2.5.8.109 No exception VS2005, C# self servicing, mssql server developer edition Standard Templates

SystemRoleTableCollection sysRoleTables = new SystemRoleTableCollection();
IPredicateExpression filterOnRole = new PredicateExpression(
    SystemRoleTableFields.RoleId == role.RowId);
sysRoleTables.GetMulti(filterOnRole);

//sysRoleTables.Sort(SystemRoleTableFields.RowId.FieldIndex,
//  ListSortDirection.Descending);
systemRoleTableCollectionBindingSource.DataSource = sysRoleTables;

Hi, I've had a look at the related threads I could find and can't understand why this is not working. I recently upgraded from GenPro 1, where I needed to add SupportsSorting in order for the XtraGrid (DevEx 7.1) sorting to work when the column header was clicked.

I disabled this line because the property doesn't exist in 2.5, as far as I can tell this should simply work. I did wonder whether it had to do with presort and tried both sort at server and sort after fetch, however with no sorting at all I get the same result, I can select the rows in the grid correctly until I sort by column header then clicking on the second row will select the row that actually contains the original second item - jumping all over the grid.

Is there something I've missed?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 18-Feb-2008 12:43:45   

Can you reproduce this using VS built in MS DataGridView?

pdm25
User
Posts: 8
Joined: 04-Feb-2008
# Posted on: 18-Feb-2008 13:56:57   

Hi,

No I can't reproduce it with the MS DataGridView, it works great, until I go back to the Devex grid and hit sort there, then they both go haywire. Unfortunately the ms grid simply isn't an option, it's more of an option to disable sorting in the devex grid, but I'm pretty sure there'll be come back from the client if I do, and in some of the other grids sorting could be critical.

I know that one of the other developers is using Genpro 2 (as opposed to 2.5) in his project and doesn't seem to face the same issue, so I wonder if it's something I'm doing, but the example is real, and there really is nothing to it, I can't see where I can doing something abnormal.

Anyway it does look kinda DevEx specific then, any ideas?

-Paul

pdm25
User
Posts: 8
Joined: 04-Feb-2008
# Posted on: 18-Feb-2008 14:05:13   

Just had a look through my devex grid properties to see if there was anything unusual set, seems pretty standard though. And as I have this on three grids on the same page all created from blank, I can't imagine there are any non-standard settings, that I didn't intend to set.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 18-Feb-2008 14:25:38   

Please bind an entityview (call .DefaultView on the collection, use that one to sort). Sorting on a collection isn't recommended, use the entity view of the collection to sort.

Sorting should work though, it's enabled by default.

Frans Bouma | Lead developer LLBLGen Pro
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 18-Feb-2008 16:50:12   

I'm using DevX Grid 7.3 with entity views and WinForms. I am not having a problem with sorting by clicking on the column header.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Feb-2008 04:14:55   

arschr wrote:

I'm using DevX Grid 7.3 with entity views and WinForms. I am not having a problem with sorting by clicking on the column header.

If I understand ok,your problem is done. Please reopen the thread if it isn't.

David Elizondo | LLBLGen Support Team
pdm25
User
Posts: 8
Joined: 04-Feb-2008
# Posted on: 19-Feb-2008 11:12:10   

No, it still doesn't work - I'm using devex 7.1. I haven't replied because I haven't had time to go back a check using .DefaultView. I'm working on another project at the moment, but as soon as I get a chance I'll go back to it and update the thread.

-paul

pdm25
User
Posts: 8
Joined: 04-Feb-2008
# Posted on: 19-Feb-2008 11:13:13   

At the moment - I'm leaving the sort functionality off on the grids, but I would like to figure out exactly how I can get this to work.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 19-Feb-2008 11:39:55   

I'm working on another project at the moment, but as soon as I get a chance I'll go back to it and update the thread.

Just reply back when you try Frans' suggestion to bind to the DefaultView of the entityCollection.