Below problem had me look for a solution for couple of hours. I finally found it and wanted to share so I can save other people spending time on it.
I have a query i
Calling Convert.ToString("Value") caused the column values to be casted from ntext to nvarchar(max) and resulting sql was CONVERT(NVarChar(max),Value). Then sorting and grouping worked just fine.