I've implemented a custom sort for a aspxgridview, following the steps mentioned here: http://documentation.devexpress.com/#AspNet/CustomDocument3818
However, I've noticed that it only sorts the current active page, so whenever I go to another page I have to click again on the column to sort it.
Is this behavior correct, or am I missing something? How can I solve it?
PS: I thought about capturing the PageIndexChanged event and manually sort the active page, but that seems too hackish...
I have not checked your code, but it seems that your code does not work, because the date1.CompareTo method does not return -1, 0 or 1 values. It might return values less than zero, equal to it and more than zero.
Please check the e.Result property value, because it can accept only these three numbers.
By the way, I see that you have a date in literal format and are trying to convert string on the fly. I think that it might be easier for you to create an unbound column that should convert dates to the appropriate format, so that you will not be concerned about writing a custom sorting event handler.
Thanks,
Vest (DevExpress Support)