The issue is probably that we store all the custom values as strings so you're ending up doing a alpha numerical sort. If you do a ToList on the query you'll be able to convert the value and sort it as a numeric value instead.
Cannot implicitly convert type 'System.Linq.IOrderedEnumerable' to 'System.Collections.Generic.List'. An explicit conversion exists (are you missing a cast?)
Variant sortOrder?
How would I change the order variants are being listed?
So, I've created a variant property called SortOrder. How would I go about using that here:
Anyone? This:
Only, that will work
I can output that value as a string and it's what I want. Why can't I sort on it?
I can output that value as a string and it's what I want. Why can't I sort on it?
OK. For anyone lese that might be having the same problem; I used this query
Hi Tony,
The issue is probably that we store all the custom values as strings so you're ending up doing a alpha numerical sort. If you do a ToList on the query you'll be able to convert the value and sort it as a numeric value instead.
var products = products.ToList();
products = products.OrderBy(x => Convert.ToInt32(x["SortOrder"]));
It doesn't like that at all
Of course
On the foreach
Silly me. I keep forgetting :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.