The Simple Answer to the WebGrid sorting issue - LINQ to Entities only supports casting EDM primitive or enumeration types
Spent so much time on this error, examining my models, data structure etc. What it boiled down to was the sortability of the IEnumerable object on the page vs a sortable list.
All you need to do most of the time is to recast it in your controller like this:
var retdata = bl.GetPidHistory(pid);
var itemstoreturn = retdata.ToList();
return View(itemstoreturn);
This is applicable when your view has a model like this: @model IEnumerable
var retdata = bl.GetPidHistory(pid);
var itemstoreturn = retdata.ToList();
return View(itemstoreturn);
This is applicable when your view has a model like this: @model IEnumerable
Comments