Pagination

I've  a clean architecture with a blazor server side project 
I don't want to retrieve the iqueryable , I just need to 
return paginated list with it's option
how can I pass this to the grid   
thanks


3 Replies 1 reply marked as answer

RN Rahul Narayanasamy Syncfusion Team April 26, 2021 02:11 PM UTC

Hi Mostafa, 

Greetings from Syncfusion. 

We have validated your query and we suspect that you want to fetch only the required number of data instead of fetching the entire data for binding the data to the Grid. You can achieve your requirement by using CustomAdaptor.  

Reference

To achieve this requirement, we suggest you to fetch the data from database based on the query received in DataManagerRequest. So now, the entire data(for example 10,000) won’t be fetched from database at initial Grid rendering, only the Take(which is defined in your GridPageSettings) number of records will be loaded. So while performing paging operation, the next set of records will be fetched. 

public class CustomAdaptor : DataAdaptor  
{  
    public OrderContext dbcontext { getset; }  
    public CustomAdaptor(OrderContext orderContext)  
    {  
        dbcontext = orderContext;  
    }  
    // Performs data Read operation  
    public override object Read(DataManagerRequest dm, string key = null)  
    {  
        IEnumerable<Order> DataSource = dbcontext.Orders; 
        . . . 
        int count = dbcontext.Orders.Count();  
        if (dm.Skip != 0)  
        {  
            DataSource = DataOperations.PerformSkip(DataSource, dm.Skip);  
        }  
        if (dm.Take != 0)  
        {  
            DataSource = DataOperations.PerformTake(DataSource, dm.Take);  
        }  
        return dm.RequiresCounts ? new Syncfusion.Blazor.Data.DataResult() { Result = DataSource.ToList(), Count = count } : (object)DataSource;  
    }  
}  


If it does not meet your requirement or if we misunderstood your requirement, then could you please share more details about your requirement. 

Please let us know if you have any concerns. 

Regards, 
Rahul  
 


Marked as answer

JR Jasa Richard July 8, 2022 12:09 PM UTC

Pagination is one of the most common troubles that we face in our work. It is a tricky thing to deal with. We cannot simply delete all paginated pages in WordPress and then quickly apply our content. Need you to get help with term paper to learn more new ways of education. And sometimes we need even more because Word Press does not support pagination through API or configurable for plugins



RS Renjith Singh Rajendran Syncfusion Team July 11, 2022 10:43 AM UTC

Hi Jasa,


We are not clear about this query. Please get back to us with the following details to proceed further.


  1. Share the details regarding the problem which you are facing with Grid pagination?
  2. Share a detailed explanation of your requirement or issue related to Syncfusion Grid.


The provided information will help us analyze the problem, and provide you a solution as early as possible.


Regards,

Renjith R


Loader.
Up arrow icon