Hello there,
I was just wondering if we can have a switch between Asc/Desc modes by clicking on the headers of the sortable columns.
Something like this:
Thanks,
Kathy
If I recall - headers are clickable to toggle up and down sorting on sortable columns.
No icon though. You maybe simulate something with styling in the sortable
CSS class with a background image or by using a custom header expression that customizes the entire header item.
+++ Rick ---
I'm not sure why the toggle is not working for me!
I have the followings set in my code:
loCol.Sortable=.T.
loCol.SortExpression = "Value"
Do I need anything more on this?
Thanks.
So I checked and columns are sortable but only in one direction. Click the link and it sorts that column and shows a *
next to the sorted column.
There's a property that determines ascending or descending via SortOrder
but there's no way to toggle. Maybe we can add a SortToggle
option and query string that would go back and forth.
+++ Rick ---
Thank you so much Rick.
Sorry if I should go to the details now but would you suggest adding the SortToggle as a grid property or column property? It looks like SortOrder is one of the grid properties, so would the behavior be natural if I add it to the grid properties?
The problem is that there's no easy way to tell if it needs to be toggled. Initial rendering needs to use the default, then subsequent click/render requires to flip the toggle. Right now there's nothing that supports that and no easy way I can think of to generically add the toggle only after the initial sort order was set.
Note you can create custom headers and that might be the better way - in there you can create a custom URL that can switch the order. Note that hte sorting happens on the server, so this isn't ideal anyway. It would be much nicer if sorting could happen on the client without having to refresh the page. But much trickier to do that...
+++ Rick ---