In this question, Add a column in IEnumerable in C # , I got the following code:
var db = Database.Open("LOS"); var ie = db.Query(sqlAssignments);
Data is displayed correctly, but the grid is no longer sorted. It is sorted fine if you pass, i.e. Instead of ie2. I have a problem if I do ToList () or not. Obviously, there is some difference between ie and ie2. Here's GetType for ie:
System.Collections.ObjectModel.ReadOnlyCollection`1[System.Object]
and for ie2:
System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Object,<>f__AnonymousType0`10[System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object]]
What should I do with ie2 so that it works with WebGrid and is sorted correctly?
c # linq webmatrix
Knox
source share