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

Grid filtering with WepApi datasource

1 Answer 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bakri
Top achievements
Rank 1
Bakri asked on 01 Apr 2014, 04:14 AM
Hi,

I'm trying to implement grid filtering where my Data Sources is webapi.

I tried to follow the following: Take a Walk on the Client Side with WebAPI and WebForms – Part 2

The grid is working fine but I'm I having an issue when I'm trying to implement filtering, there is no GetNextPage() in the request in my ApiController

My project is an ASP.NET web forms project, .net 4.5

Here is my ApiController code:

[HttpGet]
public PageResult<SecuHostUser> Load_Users(ODataQueryOptions<SecuHostUser> options)
{
     
    var context = new ApplicationDbContext();
    var users= context.Users.AsQueryable();
    var results = options.ApplyTo(users);
    return new PageResult<SecuHostUser>(results as IEnumerable<SecuHostUser>, Request.GetNextPageLink(), users.ToList().Count);
 
 
}


1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 03 Apr 2014, 11:55 AM
Hi Bakri,

Please confirm that you target 4.5 and that you have added:
using System.Net.Http;
Check out this stack overflow thread for the same issue: http://stackoverflow.com/questions/20290429/odata-using-pageresult-missing-getnextpagelink-and-getinlinecount-extension-meth

Regards,
Vasil
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Bakri
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or