Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
190
Can I Group on Column A but retain sort from Coulmn B in a grid?
posted

I have a list of documents organized by sections.  The sections have names, but they also have a section number.  Showing the user the section number is not desired, but when I show them the section names using the sortedcolumns.add(columnA, false, true) the grid then wants to sort by the section name not the intended section number

Example

1.0 = finance (10 group items) and 5.0 = absentees (10 group items) so when it shows up I really want all the "finance" items to be listed before the "absentee" items. 

I understand sorting and grouping are related, but is there a way to "un-relate" them so that I can display the data in a non-alphabetic way that maintains the underlying data sort?  Thanks in advance.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    What you need to do is use the SortComparer property of the column. You can write your own class that implements ISortComparer and set it up so that sorting the section actually sorts based on the value of the section number. From there, the GroupBy will take care of itself.


Children
No Data