Grid does'nt reload when i have 9 thousand line after ajax call

3 Answers 28 Views
Top achievements
Rank 1
wajdi asked on 07 May 2021, 03:53 PM | edited on 07 May 2021, 04:41 PM



my grid reload data after applying a custom filter so when i have 2000 lines to retrieved, the grid show it correctly but when i passed 9000 line in the result i have 500 error and the grid doesn't refresh. this my ajax call:

thanks for your helping.

Best regards.



            .Columns(columns =>
                columns.Bound(c => c.Id_Inscription     );
                columns.Bound("Nom").ClientTemplate("#=Civilite# #=Nom# #=Prenom#");
                columns.Bound(c => c.Libelle            );
                columns.Bound(c => c.DateDebut          ).Format("{0:dd/MM/yyyy}");
                columns.Bound(c => c.DateFin            ).Format("{0:dd/MM/yyyy}");
                columns.Bound(c => c.CDV  ).ClientTemplate("<span id = 'badge_#=CDV#' class='badgeTemplate'></span>").Width(80);
                columns.Bound(c => c.LibelleEntreprise  );
                columns.Bound(c => c.Code_Financement   );
                columns.Bound(c => c.CodeDepartement    );
                columns.Bound(c => c.ContactEcole       );
                columns.Bound(c => c.Gestionnaire);
                columns.Bound(c => c.GestDosAdmin       );
                columns.Bound(c => c.StatutDosAdmin     );
            .ToolBar(toolbar =>
            }).Excel(excel => excel.AllPages(true))
            .Pageable(pageable => pageable
            .Resizable(r => r.Columns(true))
            .Reorderable(r => r.Columns(true))
            .Events(e => e.DataBound("onDataBound"))
            .Pageable(pageable => pageable
            .DataSource(dataSource => dataSource
                .Events(events => events.Error("error_handler"))
                .Model(model =>
                    model.Id(p => p.Id_Inscription);
                    model.Field(p => p.Civilite         ).Editable(false);
                    model.Field(p => p.Nom              ).Editable(false);
                    model.Field(p => p.Prenom           ).Editable(false);
                    model.Field(p => p.Libelle          ).Editable(false);
                    model.Field(p => p.DateDebut        ).Editable(false);
                    model.Field(p => p.DateFin          ).Editable(false);
                    model.Field(p => p.LibelleEntreprise).Editable(false);
                    model.Field(p => p.Code_Financement ).Editable(false);
                    model.Field(p => p.CodeDepartement  ).Editable(false);
                    model.Field(p => p.ContactEcole     ).Editable(false);
                    model.Field(p => p.GestDosAdmin     ).Editable(false);
                    model.Field(p => p.StatutDosAdmin   ).Editable(false);
                    model.Field(p => p.Gestionnaire     ).Editable(false);
                .Read("GetAllFolders", "RechercheDossiers")

            url: '@Url.Action("GetFiltredFolders", "RechercheDossiers")',
            type: "Post",
            data: { nom, prenom, dateDebut: dateD, dateFin: dateF, sAnticipee, pFormations, financements, gestionnaires },
            traditional: true,
            dataType: 'json',
            async: true,
            success: function (result) {
                searchResults = result;
            error: function (xhr, ajaxOptions, thrownError) {
            timeout: 30000,
            cache: false
        }).done(function () {
            var dataSource = new{ data: searchResults });
            var grid = $('#Dossiers').data("kendoGrid");
   () {
            var pageSi = grid.dataSource._pageSize
            grid.dataSource.query({ page: 1, pageSize: pageSi });

        public async Task<JsonResult> GetFiltredFolders(DateTime? dateDebut, DateTime? dateFin,
            bool sAnticipee, string nom, string prenom, string financements, string pFormations, string gestionnaires)
            string departments = Session["department"].ToString();

            List<Dossier> dossiers = await _conventionDeFormationService.LoadFoldersByAccess(departments, dateDebut, dateFin,
             sAnticipee, nom, prenom, financements, pFormations, gestionnaires);

            return Json(dossiers, JsonRequestBehavior.AllowGet);


3 Answers, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 07 May 2021, 05:20 PM | edited on 10 May 2021, 09:14 AM

i resolve my problem by oveeriding the jsonresult method but the grid make too much time to reload the result more than 30 seconds. can any one have a solution for this also i want to show the loader for grid to handle this moment of waiting, any suggestion?


 protected override JsonResult Json(object data, string contentType, System.Text.Encoding contentEncoding, JsonRequestBehavior behavior)
            return new JsonResult()
                Data = data,
                ContentType = contentType,
                ContentEncoding = contentEncoding,
                JsonRequestBehavior = behavior,
                MaxJsonLength = Int32.MaxValue

Top achievements
Rank 1
answered on 10 May 2021, 12:31 PM

to display the loader for the grid when loading data, i use this javascript function to handle it.


function showloader() {
        $('<div class="k-loading-mask" style="width: 100%; height: 100%; top: 0px; left: 0px;"><span class="k-loading-text">Loading...</span><div class="k-loading-image"></div><div class="k-loading-color"></div></div>').appendTo('#Grid-id .k-grid-content');

Anton Mironov
Telerik team
answered on 12 May 2021, 10:41 AM

Hello Wajdi,

Thank you for the details and for sharing the resolving approach of the main issue.

In order to use a loading indicator, I would recommend trying the implementation from the following knowledge base article:

Here is a runnable example:

Begin the progress of the loader in the Ajax request and end it in the "success" scope.

I hope this information helps.

Kind Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at

Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Anton Mironov
Telerik team
Share this question