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

Filter and Entity Framework

2 Answers 83 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Silvio Silva Junior
Top achievements
Rank 2
Silvio Silva Junior asked on 28 May 2010, 03:28 PM
Hello guys.

I'm trying to use a filter with my grid like this example:
http://demos.telerik.com/aspnet-ajax/filter/examples/integration/defaultcs.aspx

but, if I use this sample code:

ObjContext entities = new ObjContext();  
ObjectResult<EntitiesResult> myEntities = entities.usp_get_entities();  
return myEntities.AsQueryable(); 

The filter doesn't affect the grid. However if I use this sample code:
DataTable dtEntities = DataBase.ExecuteReaderDt(CommandType.StoredProcedure, "USP_GET_ENTITIES"); 
return dtEntities; 

The filter works fine.

Note that is the same stored procedure for both cases.

I'm forgetting something? For EF is a different way?

Another question is:

How can I remove a field from filter, like: The customer's ID. I don't want this field in filter. How can I remove it?

Regards.

2 Answers, 1 is accepted

Sort by
0
Silvio Silva Junior
Top achievements
Rank 2
answered on 28 May 2010, 08:35 PM
Hey guys, I think this problem occurs because the use of Entity Function Import.

I try with a custom linq query and it works fine, but, with a function import (of a Stored Procedure), it not work.

I really need this functionality working with functions import, because our software is based on stored procedures and Entity Framework.

Regards.
0
Nikolay Rusev
Telerik team
answered on 02 Jun 2010, 09:23 AM
Hello Silvio,

The problem in this case is because when you call AsQueryable result collection is transformed into forward-only enumerable. In this case filter expressions should be in SQL like format.

We are aware of this and have already addressed the issue. You can keep track of the latest internal build till' the end of the week where the fix will be published.

Kind regards,
Nikolay
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
Filter
Asked by
Silvio Silva Junior
Top achievements
Rank 2
Answers by
Silvio Silva Junior
Top achievements
Rank 2
Nikolay Rusev
Telerik team
Share this question
or