Menu

AlwaysGroupByColumn and Sorting

2009-01-28
2012-10-30
  • Michael Coffey

    Michael Coffey - 2009-01-28

    I have this working in version 1.13, but, using the same code, it appears that it no longer works the same way.

    When a user selects what column they want to group by, I set the AlwaysGroupByColumn property to that column, and set the AlwaysGroupBySortOrder to SortOrder.None so that the user can group on one column and sort by another.

    I have tried several different variations of setting these properties and rebuilding the list or setting the objects,but nothing seems to get it to work, including the way it was working in 1.13.

    What happens now is that the rows are grouped by the column, but you can no longer sort by the column you click on. The sort icon stays on the grouped column.

    Am I doing something wrong, or could this perhaps be a bug that was introduced?

    Thanks for your help :)

     
    • Michael Coffey

      Michael Coffey - 2009-03-09

      Hi Phillip,
      Have you had a chance to look into this yet?

      If it's something you won't be able to get to for a while, maybe you could just point me towards the problem and I can put in a temp fix myself for a while until you get back around to it.

      Thanks,
      Mike

       
    • Michael Coffey

      Michael Coffey - 2009-01-28

      Sorry, meant to say that I am using 2.1 now.

       
    • Michael Coffey

      Michael Coffey - 2009-01-28

      Here is the code that worked in 1.13

      list.BeingUpdate();
      list.AlwaysGroupByColumn = list.AllColumns[x];
      list.ShowGroups = true;
      list.AlwaysGroupBySortOrder = SortOrder.None;
      list.BuildGroups();
      list.BuildList();
      list.EndUpdate();

       
    • Phillip Piper

      Phillip Piper - 2009-01-29

      Hi there,

      Hmm. You're quite right. Sigh!

      I'll have a look at it and try to have a fix in place for the 2.1 release. The fix will, of course, be available in the SVN before that.

      Thanks for taking the time to report this bug.

      Regards,
      Phillip

       
    • Phillip Piper

      Phillip Piper - 2009-02-02

      The version I checked into the SVN tonight should fix this problem.

      Give it a try -- if you're brave :)

      Regards,
      Phillip

       
    • Michael Coffey

      Michael Coffey - 2009-02-03

      I got your latest out of the SVN, and it does sort now, but the sort icon stays on the group column.

      Thanks

       
    • Phillip Piper

      Phillip Piper - 2009-02-06

      There's always one more problem :)

      Frustratingly enough, that one little thing is not very easy to remove. I'll have to give a bit of thought to how to rework the AlwaysGroupsBy stuff. It's becoming ugly -- and I hate ugly code :)

      Regards,
      Phillip

       

Log in to post a comment.