Want to load large data which contains 120000 row in grid but it's throwing Error

hello sir,

I have a table with 12000 record..  I want to load it on grid. but whenever I want to do that every time it's throw the exception of MaxjsonLength related error.

Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

Please provide me the proper solution for that .  I'm using  Syncfusion grid EJ1 and working on asp.net mvc plateform.

It's very urgent. Please help me.

4 Replies

VK Vikash Kumar August 11, 2018 10:58 AM UTC

Please check this table script....  I want to load the complete data into the syncfusion grid.... there are more then 12000 datarow in this sql server script. But I unable to load data into the grid.

Attachment: scriptnew_94093e20.zip


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team August 13, 2018 07:19 AM UTC

Hi Vikash,  
 
Thanks for contacting Syncfusion Support.  
 
The cause of the problem is record count in your case is larger. So the JavaScriptSerializer has thrown an exception. We have already discussed about this in the following KB.  
 
 
To overcome this problem, we suggest to use the EnableVirutlaization property of the ScrollSettings, which render a scroller and the records were rendered virtually while scrolling the Grid. Refer to the following Help Document.  
 
 
Since you are using a large number of records, load on demand concept is the recommended way to handle this along with the Virtual Scrolling feature. Refer to the following Help Document.  
 
 
Regards,  
Seeni Sakthi Kumar S. 



VK Vikash Kumar August 13, 2018 12:29 PM UTC

Thanks for reply Seeni , If you don't mind will you please create one sample project example for me with the given (attached) table script for this problem. I really didn't understand how to implement this with larger data.

I tried many times from my side but I didn't get appropriate result. I already provided you the table..  that table contains more then 12000 data in this script. Please use this table and send me one sample in asp.net mvc so that I can understand the use of virtual scrolling.. as you suggest me for this. It's very urgent so please help me.

Thanks & regards
Vikash

Attachment: scriptnew_15fb733e.zip


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team August 14, 2018 08:46 AM UTC

Hi Vikash Kumar, 
 
We are unable to connect the provided Table. Please refer to the screenshot. 
 
 
We have bind the large number of data to URL dataSource with 30000 records with Virtual Paging Enable. Please refer to the sample Link:- 
 
 
Please refer to the code example:- 
@(Html.EJ().Grid<SyncfusionMvcApplication7.Models.C30000Records>("Grid") 
            .Datasource(ds => ds.URL(@Url.Action("DataSource")).Adaptor(AdaptorType.UrlAdaptor))  
            .AllowScrolling() 
            .AllowSorting() 
            .ScrollSettings(scroll => 
            { 
                scroll.AllowVirtualScrolling().Height(300). 
                    VirtualScrollMode(VirtualScrollMode.Normal); 
            }) 
                 
                    .Columns(col => 
                    { 
                        col.Field("CustomerID").IsPrimaryKey(true).Add(); 
                        col.Field("CompanyName").Add(); 
                        .     .    . 
              }) 
) 
 
Controller side:- 
 
   public class HomeController : Controller 
    { 
        public IEnumerable OrderData = new NORTHWNDEntities().C30000Records.ToList(); 
        public ActionResult Index() 
        { 
 
            return View(); 
        } 
 
         
 
        public ActionResult DataSource(DataManager dm) 
        { 
            IEnumerable data = OrderData; 
            DataOperations operation = new DataOperations(); 
            if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting 
            { 
                data = operation.PerformSorting(data, dm.Sorted); 
            } 
            if (dm.Where != null && dm.Where.Count > 0) //Filtering 
            { 
                data = operation.PerformWhereFilter(data, dm.Where, dm.Where[0].Operator); 
            } 
            int count = data.AsQueryable().Count(); 
            if (dm.Skip != 0) 
            { 
                data = operation.PerformSkip(data, dm.Skip); 
            } 
            if (dm.Take != 0) 
            { 
                data = operation.PerformTake(data, dm.Take); 
            } 
            return Json(new { result = data, count = count },JsonRequestBehavior.AllowGet); 
        } 
 
 
Regards,  
Seeni Sakthi Kumar S. 


Loader.
Up arrow icon