Home Forums WPF controls Xceed DataGrid for WPF Grouping thrown off when sorting another column

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #23756 |

    Hi,

    First, thanks for an excellent datagrid that solves a significant lack in the WPF framework as released.

    I’m having an issue with grouping and sorting. I have an XML file containing the 10-year USD Treasury bond rate as it stood in each month since January 1925. It’s a simple data set; there are only three headings: year, month and rate.

    If I group by year and then click on the ‘Month’ column to sort by month, I’d expect it to maintain the year groupings and sort from 01 – 12 within each year. If I repeatedly click the ‘Month’ column I expect it to alternate sorting 01 – 12 and then 12 – 01.

    What’s happening, though, is that it sorts the months properly but the year groups get thrown into what seems to be random order, starting as follows:

    1969
    1968
    1967
    1971
    1970
    1932
    1966

    If I reverse-sort the months (again by clicking on the Months column), then the months sort as expected but the year order becomes:

    1939
    1985
    1964
    1984
    1938
    1937
    1995

    I tried the KB but no results came up for “sort” or “sorting.” I also searched in the forum for issues related to “sorting” but couldn’t find anything on this, so I decided to post.

    Thanks everyone,

    Chuck McKinnon.

    Imported from legacy forums. Posted by Chuck (had 447 views)

    Xceed Support
    Member
    Post count: 5658

    Grouping a by a column does not automatically sort by that column…

    What you want to do is Group by Year, then Sort by Year, and add a second sort (Shift-Click) by Month.

    That should do the trick.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 2663 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.