Hello
I have a WebDataGrid bound to a DataView, with sorting enabled. About half of the columns contain strings and the other half contain numbers. Is there a way that would allow that numeric columns to sort in descending order by default (instead of sorting ascending and then descending), while keeping the string column's sort to be ascending?
Hi,
The column settings unfortunately won't do this for you. But you can perform it relatively easily. You will want to handle the column sorting client event. Off of the event args, you can get the column and the sort direction about to be applied. You can check if the column is already sorted from the sorting behavior. If it is not, then check the column type and set the sort direction to what you want- descending for numbers and ascending for text. Let me know if you need help with the code.
regards,David Young
Hello,
I have the exact same need. If this can be done by JS/JQuery, can you provide sample code.
Thanks,
Abhay
I am also looking for an example. Please supply one? Thank you