We have almost found a way to get this to work, which I feel we should share. After looking through the code for Dynamic LINQ, we noticed that there is not where() statement taking only one parameter, so something like this:
Won't actually use Dynamic LINQ at all but probably one of the build in wheres in Entity Framework 4.
However, just changing to:
Will instead trigger the call to Where() in DynamicLINQ (Dynamic.cs), which works.....almost.
The almost comes from the fact that the LINQ generated by RadGrid isn´t fully compatible with Linq-to-entities. It will generate a filterExpression like:
"(iif(TestColumn== null, \"\", TestColumn).ToString().ToUpper().Contains(\"te\".ToUpper()))"
which will cause this:
LINQ to Entities does not recognize the method 'System.String
ToString()' method, and this method cannot be translated into a store
Simply removing the ".ToString()" part form the filterExpression will make everything work, so the obvious question is, must it really be in there to begin with in the Linq generated by RadGrid?
(Please see here for more information etc. http://www.drowningintechnicaldebt.com/RoyAshbrook/archive/2010/06/04/some-ef-weirdness-linq-to-entities-does-not-recognize-the.aspx