We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Pulling an entire data source? Why not IQueryable

Thread ID:

Created:

Updated:

Platform:

Replies:

123999 May 6,2016 09:16 PM UTC May 9,2016 10:22 AM UTC ASP.NET MVC 1
loading
Tags: Grid
Micah Osborne
Asked On May 6, 2016 09:16 PM UTC

So i'm using the mvc grid and the UrlAdaptor Data source which returns a result set.  I can't seem to get it to work with IQueryable though.  every time i move to another page (Using Paging) it pulls the entire table.  I'm using entity framework.  Any insight on how this could be accomplished without loading every single record?

Gowthami V [Syncfusion]
Replied On May 9, 2016 10:22 AM UTC

Hi Micah, 

We have analyzed your query and we suspect that you may returned all the data without performing skip and take operations in server side as follows, 

@(Html.EJ().Grid<OrderTable>("Grid") 
        .Datasource(ds => ds.URL("GetEmployeeData").Adaptor(AdaptorType.UrlAdaptor)) 
        .PageSettings(page => { page.PageSize(3); }) 
        . . . . 
  ) 
 
ActionResult GetEmployeeData(DataManager dm) 
{ 
. . . .  
. . . . 
int count = data.AsQueryable().Count(); 
            DataOperations operation = new DataOperations(); 
            
            //Performing paging operations 
            data = operation.PerformSkip(data, dm.Skip); 
            data = operation.PerformTake(data, dm.Take); 
            
            return Json(new { result = data, count = count }, JsonRequestBehavior.AllowGet); 
 
        } 


Refer to the below screenshot, 

 

While using UrlAdaptor we need to perform all the grid actions like Filtering, Sorting, Searching and Summary in the server side. 

Refer to the below link for more clarification, 


We have created a sample for your reference and the same can be downloaded from the following link, 


Regards, 

Gowthami V. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;