Filter and Entity Framework

3 posts, 0 answers
  1. Silvio Silva Junior
    Silvio Silva Junior avatar
    100 posts
    Member since:
    Mar 2010

    Posted 28 May 2010 Link to this post

    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. Silvio Silva Junior
    Silvio Silva Junior avatar
    100 posts
    Member since:
    Mar 2010

    Posted 28 May 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 02 Jun 2010 Link to this post

    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.
Back to Top