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

Fetch records based on pagesize and pagecount in Suncfusion grid

Thread ID:

Created:

Updated:

Platform:

Replies:

123796 Apr 22,2016 05:43 AM UTC Apr 25,2016 07:30 AM UTC JavaScript 1
loading
Tags: ejGrid
Pankaj
Asked On April 22, 2016 05:43 AM UTC


I have the requirement that while binding data to Syncfusion grid I want to load data based on pageSize and pageNumber. For e.g if pagesize is 10 and when user on 2nd page of grid then it will fetch the records from 11-20.I have written the stored procedure like only I am not able to pass startindex and pagecount to my controller action.Currently what happens that it initially fetch all the records from database because of that performance is very slow.


Ragavee U S [Syncfusion]
Replied On April 25, 2016 07:30 AM UTC

Hi Pankaj, 

Thanks for your interest in Syncfusion products. 

We understand your requirement to load data based on the page size and current page in Grid. We can achieve this requirement using the “Load on Demand” technique of the ejDataManager. The details of the number of data to be retrieved will be obtained in skip and take parameters of the DataManager Class. Please refer to the following code example on how the data is filtered using the skip and take parameters of the DataManager Class 

public ActionResult Event(DataManager dm) 
        { 
            IEnumerable DataSource = OrderRepository.GetAllRecords(); 
            DataResult result = new DataResult(); 
            DataOperations operation = new DataOperations(); 
            result.result = DataSource;  
            result.count = result.result.AsQueryable().Count(); 
            if (dm.Skip > 0) 
                result.result = operation.PerformSkip(result.result, dm.Skip); 
 
            if (dm.Take > 0) 
                result.result = operation.PerformTake(result.result, dm.Take); 
 
            return Json(result, JsonRequestBehavior.AllowGet); 
        } 
 
Please refer the below screenshot: 

 
 
We have created a sample using URL Adaptor, which can be downloaded from the below location. 


Please refer to the below online documentation for more information on the adaptors. 




Regards, 
Ragavee U S. 


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

;