Load Records only on Search

I have a large amount of records.  Currently I only load the first 25 records on OnInitializedAsync.  

  1. It takes about 1 second to load the small amount of records but much longer to load all the records.
  2. Is there a way to only load 1 page of records, and then load the remaining records once a search is enabled?

I tried virtualization and paging, but they tend to load slowly as well.  What is best practice? I was thinking for this particular table to do a custom query that returns records on the search.

Thank you.


3 Replies

RS Renjith Singh Rajendran Syncfusion Team December 20, 2021 12:28 PM UTC

Hi Stephen, 
 
Greetings from Syncfusion support. 
 
We suspect that there might be some delay with fetching data from your service inside OnInitializedAsync, might be causing this delay. If so, then based on this scenario we suggest you to check by rendering SfGrid based on the availability of data assigned for Grid as like the below code, 
 
 
@if(Orders!= null) 
{ 
    <SfGrid DataSource="@Orders" AllowPaging="true"> 
     <GridPageSettings PageSize="20"></GridPageSettings> 
      ... 
    </SfGrid> 
} 
 
@code{ 
    public List<Order> Orders { getset; } 
         … 
} 
 
 
 
And also we would like to inform you that, it is a must to enable Paging or Virtualization features in Grid when loading large data to improve performance. We have already documented this in our online documentation, please refer the link below for more details, 
 
Please get back to us if you need further assistance. 
 
Regards, 
Renjith R 



SL slynch December 28, 2021 09:14 PM UTC

Thank you. It still takes 15 seconds to load 17k records.  Can I override the standard search box or do I have to use a custom template?



RS Renjith Singh Rajendran Syncfusion Team December 29, 2021 01:34 PM UTC

Hi Stephen, 
 
We have already discussed a similar topic of rendering custom textbox for searching. Please refer the below thread of more details, 
 
You can either use SfToolbar or the RenderFragment suggestion from above thread to render custom search textbox in Grid. 
 
And also we are not clear about the exact scenario you are facing delay in loading records problem. If you are still facing difficulties then we need the following details to further procced on this. Kindly share with us the following details for better assistance. 
 
  1. Share with us a simple issue reproducing sample for us to validate.
  2. Share a video demo explaining the replication of the problem you are facing.
  3. Are you facing delay in binding data to Grid? Or are you facing delay in fetching data from your database?
 
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