Description
Background and Motivation
QuickGrid's out of the box sorting is nice but makes some things challenging like swapping an icon class out on a column's HeaderTemplate because there's no way for the column to know if it's currently being sorted by. Tracking it with the column itself is also only a partial answer because there's not way to tell that another column has become the sort column.
I'd like to get some feedback on improving this and adding the ability to perform multi column sorting. My thought is the current SortByColumnAsync woud stay in place but it's functionality would be changed from storing a single column and sort direction to working against a list of "SortColumn" that stores this data.
I propose adding additional methods "AddUpdateSortByColumnAsync" that appends an additional sort column to the list when it is not already present, otherwise updates it's sort direction. The other method would be "RemoveSortByColumnAsync" to clear sorting from a given column.
I imagine there are scenarios where developers may want to do something like allow multi sort based on Ctrl+Click, ColumnOptions dialogs, etc. I think having the existing method just clear all other filters and fall through to AddUpdateSortByColumnAsync maintains current functionality without breaking existing implementations and also makes it trivial to essentially clear all sorting columns and start over.
Once this is implemented it would be easy for the grid to expose a method to check if a column is currently being sorted and retrieve it's sort direction which makes the scenario where you want to, for example, swap out a font-awesome icon within a column a lot simpler than it is today.
Obviously the ItemsProvider request would need to be updated to expose this as well. That's actually already a collection though so it doesn't appear that would end up being a breaking change on that side of it.
The other thing I've found that could use some work is pagination. There is at least one bug when using pagination. If you have a dataset that spans say 10 pages and your current ItemsPerPage is set to 10 and go to page 10 then change ItemsPerPage to 20 you're left on page 10 with no data and a bunch of empty pages until you get back to page 5. It seems like this should recalculate on the fly and move the user to the new last page internally.
Additionally, if you change ItemsPerPage it should recalculate the current page number to keep the data in view. Currently it will result in the data being moved to a different page and leave the user on the same page which is not the best experience for the user.
Just want to get some feedback before going too deep with what this should look like and how it should work.