Dette har jeg sakset fra:
http://quickstart.developerfusion.co.uk/QuickStart/aspnet/doc/data/databases.aspxThe SqlDataSource control supports sorting when its DataSourceMode property is set to "DataSet". To enable the sorting UI in the GridView, set the AllowSorting property to true. This causes the GridView to render link buttons for its column headers that can be clicked to sort a column. The GridView control passes the SortExpression associated with the column field to the data source control, which returns the sorted data to the GridView.
The SortExpression syntax expected by SqlDataSource is the same syntax as the Sort property of System.Data.DataView, although other data sources might support a different syntax. Because the sorting behavior of SqlDataSource relies on the underlying DataView Sort property, sorting is only supported by SqlDataSource when in DataSet mode; if set to DataReader mode, sorting will be disabled. Typically you will set the SortExpression to a single field name associated with a column of the GridView. The GridView automatically alternates between appending "ASC" or "DESC" to the SortExpression on each click, to toggle between ascending and descending sort order.
--------
I hht ovenstående, så foretages sorteringen direkte i det underliggende dataset, som du jo ikke ændrer i, ved at anvende Decrypt(Eval("Navn")) osv.
Den nærliggende tanke er vel at erstatte de krypterede værdier i datasettet med de dekrypterede, eller klone datasettet og deri foretage erstatningen. Plan B kunne være, at komme med sin egen sort-algoritme, men jeg ved hvad JEG ville vælge :-)
Måske har andre et bedre bud.