This is a migrated thread and some comments may be shown as answers.

Error in filtering grid when data source is LinqDataSource

1 Answer 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
reza meshksar
Top achievements
Rank 1
reza meshksar asked on 20 Oct 2010, 12:30 AM
In my form I have a RadGrid control and the data source is LinqDataSource which is connected to Entity Framework Model.

Everything works fine except when I am trying to do filtering on columns. For example when I try to apply contains filter on a string column I am getting this error:

LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.


We are using DataSourceID property in the grid for data binding.

I tried EntityDataSource as datasource and filtering works fine, but we have to use LinqDataSource in our specific case.

Any ideas why it happens?

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 25 Oct 2010, 09:49 AM
Hello,

Linq to Entities does not support as many conversion of functions to server hosted sql.

ToString (on anything) is one of them

Here's a post suggesting workarounds and here's the list of supported functions



All the best,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
reza meshksar
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or