Error in Grid when it have been loaded with many records

Hello!

I'm using the Grid component of Syncfusion for ASP.NET WebForms, and when I work with a very large amount of records the following error occurs:
Error during serialization or deserialization using JSON JavaScriptSerializer. The size of the string exceeds the value set in the maxJsonLength property.

To load the Grid, I select the data in my database and set it to the data source. I would like to know if the component already has any solution to solve this problem and how I could do it.

Thank you very much!

3 Replies

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team May 10, 2018 05:19 PM UTC

Hi Luis, 

Thanks for contacting Syncfusion Support. 

Query #:- Error during serialization or deserialization using JSON JavaScriptSerializer. The size of the string exceeds the value set in the maxJsonLength property. 

We have checked your query and we have already discussed about this problem in our Syncfusion Knowledge Base documentation. Please refer to the KB link:- 


Please get back to us if you need any further assistance. 

Regards, 
Farveen sulthana T 



LF Luis Fernando May 11, 2018 07:07 PM UTC

Hello, Farveen,

To work with a lot of records on the grid, I'm using load on demand. I followed the example provided in the link: https://asp.syncfusion.com/demos/web/grid/webmethodadaptor.aspx.

But I have two problems:
1 - When I click on column to sort, I lose all the records of the grid.
2 - When I want to filter my grid, I update the data source, the grid is reloaded, but the number of pages and records are not updated, remain the same.

I have already researched the Syncfusion forum, but I didn't find anything that would help me solve this.


FS Farveen Sulthana Thameeztheen Basha Syncfusion Team May 14, 2018 12:50 PM UTC

Hi Luis,  
 
Query #1 :- When I click on column to sort, I lose all the records of the grid. 
Query # 2 - When I want to filter my grid, I update the data source, the grid is reloaded, but the number of pages and records are not updated, remain the same. 
 
We have checked your query and this reported problem occurs when doesn’t return the result and count value properly after performing the dataOperations. we can  perform filtering, sorting and searching operations on server side and need to define the count value after performing these operations and return count value to the Grid. If we return the count value before performing these operations, it doesn’t return the filtered or sorted records, instead it will show the total number of records.  So we suggested you to define the count value after performing these operation and return to the Grid. 
 
Please refer to the code example:- 
 
public static object UrlDataSource(Syncfusion.JavaScript.DataManager value) 
        { 
            IEnumerable data = BindDataSource(); 
            DataOperations ds = new DataOperations(); 
             
            if (value.Where != null && value.Where.Count > 0) //Filtering 
            { 
                 
                data = ds.PerformWhereFilter(data, value.Where, value.Where[0].Operator); 
            } 
            
            if (value.Search != null && value.Search.Count > 0) // Searching 
            { 
                data = ds.PerformSearching(data, value.Search); 
            } 
 
            var count = data.AsQueryable().Count(); 
            if (value.Sorted != null && value.Sorted.Count > 0) //Sorting 
            { 
                data = ds.PerformSorting(data, value.Sorted); 
            } 
            List<string> str = new List<string>(); 
             .  .   . 
            IEnumerable aggregates = ds.PerformSelect(data, str); 
            if (value.Skip > 0) 
            data = ds.PerformSkip(data, value.Skip); 
            if (value.Take > 0)   //Paging 
            data = ds.PerformTake(data, value.Take); 
 
            return new { result = data, count = count, aggregate = aggregates }; 
        } 

Please refer to the KB link:- 

After following the above solution still facing the issue, please share us the following details. 

1. Complete Grid code example (both in server and client side). 
2. If possible provide an issue reproducing sample . 
3. Screenshot/Video Demo to replicate the issue. 

Regards, 
Farveen sulthana T 


Loader.
Up arrow icon