Menu

2.9.1 Secondary Sorting Bug

2016-06-15
2018-04-27
  • Dave Cousineau

    Dave Cousineau - 2016-06-15

    If you lock a grouping, and then try secondary sorting, it doesn't work.

    This is caused by the logic being backwards on this line in the MakeGroups function:

    OLVColumn sortColumn = parms.SortItemsByPrimaryColumn ? parms.ListView.GetColumn(0) : parms.PrimarySort;

    Need to either switch the values, or add a boolean not:

    OLVColumn sortColumn = !parms.SortItemsByPrimaryColumn ? parms.ListView.GetColumn(0) : parms.PrimarySort;

    or

    OLVColumn sortColumn = parms.SortItemsByPrimaryColumn ? parms.PrimarySort : parms.ListView.GetColumn(0);

     

    Last edit: Dave Cousineau 2016-06-15
  • Phillip Piper

    Phillip Piper - 2018-04-27

    For anyone else reading this...

    The above code does work... but for the wrong reasons :) Don't put this change into your code.

    I've checked in a fix to the repo, and it will be included in the next release.

     

Log in to post a comment.

MongoDB Logo MongoDB