I'm attempting to bind a generic list to a RadGrid. This works:
But the following does not. The only difference is the addition of 'where' in the LINQ code. When I run in the debugger, the legList contains the expected number of records in both cases, but no records are displayed in the grid in when I bind after specifying the where condition. Am I missing something?
| List<int> originList = new List<int>(); |
| originList.Add(24); |
| originList.Add(328); |
| myDataContext dc = new myDataContext(); |
| List<Leg_ListResult> legList = (from l in dc.Leg_List() |
| // where originList.Contains((int)l.OriginWaypointID) |
| select l).ToList(); |
| gridLegs.DataSource = legList; |
But the following does not. The only difference is the addition of 'where' in the LINQ code. When I run in the debugger, the legList contains the expected number of records in both cases, but no records are displayed in the grid in when I bind after specifying the where condition. Am I missing something?
| List<int> originList = new List<int>(); |
| originList.Add(24); |
| originList.Add(328); |
| myDataContext dc = new myDataContext(); |
| List<Leg_ListResult> legList = (from l in dc.Leg_List() |
| where originList.Contains((int)l.OriginWaypointID) |
| select l).ToList(); |
| gridLegs.DataSource = legList; |