0
votes

I am using Kendo UI grid (MVC Wrappers), ASP.NET MVC 3, and Jquery.

I have an editable batch mode Kendo grid. In many instances this grid will have 30 or 40 rows that are all editable to the user. When the user clicks the submit button, the Kendo software places all of the updated rows of the grid in a collection and sends them to the server for processing. All works fine when the number of rows that the user edited is less than 18. If the user edits 17 records, they all get sent to the controller perfectly fine. If the user edits 18 records or more, it errors out and it never even hits my break points on the server. The error message is not meaningful either as it is just a bunch of HTML taken from my page.

Here is what my controller action method looks:

[AcceptVerbs(HttpVerbs.Post)]
    public ActionResult _AjaxUpdateFields([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<People> updatedPeople)
    {
        //DO STUFF WITH UPDATED DATA
    }

Here is what my grid setup loos like:

Html.Kendo()
.Grid<MyProject.Models.Domain.Students>()
.Name("Students")
.Sortable(settings => settings.Enabled(false))
.Filterable(settings => settings.Enabled(false))
.Resizable(resizing => resizing.Columns(true))
.Scrollable(settings => settings.Enabled(true))     
.HtmlAttributes(new { style = "font-size: 85%;" })
.Columns(columns =>
    {
        columns.Bound(o => o.StudentId).Title("StudentId").Hidden();
        columns.Bound(o => o.Name).Title("Student Name").Width(200);
        columns.Bound(o => o.teacher).Title("Teacher")
             .ClientTemplate("#=data.teacher ? teacher.teacherName : ''#").Width(150).Filterable(false);
    })
    .DataSource(dataSource => dataSource.Ajax()
                                        .Batch(true)
                                        .ServerOperation(false)
                                        .Model(model =>
                                            {
                                                model.Id(c => c.StudentId);
                                                model.Field(c => c.teacher);                                                       
                                            })
                                            .Events(events => events.Error("Field_onError"))
                                            .Read(read => read.Action("_AjaxGetFields", "Student"))
                                            .Update("_AjaxUpdateFields", "Student")
                                            .Destroy("_AjaxDelFields", "Student"))
    .Events(events => events.DataBound("Fields_onDataBound")
                            .Change("onFieldSelect")
                            .Edit("onFieldEdit")
                            )
    .ToolBar(commands =>
        {
            commands.Save().HtmlAttributes(new { id = "saveField" }); 
        })
    .Scrollable(scrollable => scrollable.Height("375px"))
    .Selectable()
    .Editable(editing => editing.Mode(Kendo.Mvc.UI.GridEditMode.InCell)).Render();

So I'm thinking since I can do 17 records perfectly fine, but as soon as it hits 18 or more it crashes, there must be some limit or maximum somewhere that I need to modify?

Does the Kendo grid have a limit to the number of rows it can send back to the controller at the time?

Could it be possible that there is some MVC, IE, or Web Server setting that is limiting this? Or something in Jquery that may need to be set?

1

1 Answers

1
votes

I finally found the solution. This can be marked as answered.

I needed to add this to my web.config:

<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="3000"/>