Product Sorting
I'm working on Browse.aspx from the starter site and I want to implement sorting functionality based on the column header in the GridView.
I know the productList control uses the ProductFilterDataSource control to get it's data and ProductFilterDataSource inherits from CatalogDataSource.
I think I've done everything correctly, but the error I keep getting is "The data source does not support sorting."
Anyone have any ideas or guidelines I should be following to get this working?
Thanks,
Brad
[577 byte] By [
takobell] at [2007-12-27]
Hi Joe,
Thanks for the input. I had gotten that far and was attempting to handle the onsorting event to get bi-directional sorting working. That's actually when I got the error I originally posted about.
I'd love to see your solution to the problem.
Regards,
Brad
Anyone found a solution to bidirectional sorting ?
i keep getting this error when i try to reverse sort
'Invalid column name 'DisplayName DESC'.
Best regards
Philip Haugaard
It may not be the most efficient way, but I passed the sortexpression into a function that parses it out and does a catalog search for products and sets the SortDescending property of the searchOptions to a boolean based on whether DESC is found in the sortParams string. The searchOptions class also supports paging parameters that translate pretty closely to the ObjectDataSource paging params (startRowIndex, maximumRows) , which is why I went with this method.
Take a look at the CatalogSearch and SearchOptions classes in the Class Reference for more info.
Hope that helps,
Dave