.NET Core Grid - Batch with Inline Edit

4 posts, 0 answers
  1. Paul
    Paul avatar
    7 posts
    Member since:
    Dec 2019

    Posted 12 Feb Link to this post

    Hi there,

    I can see from your Batch editing demo that the grid is configured to use InCell editing mode. However, I am trying this with InLine editing mode:

     

    @(Html.Kendo().Grid(Model.MapDetails)
                    .Name("MapDetails")
                    .Columns(columns =>
                    {
                        columns.Bound(p => p.Scale).Title("Scale");
                        columns.Bound(p => p.PageNo).Title("PageNo");
                        columns.Command(command => { command.Edit(); command.Destroy(); });
                    })
                .Editable(editable => editable.Mode(GridEditMode.InLine))
                .ToolBar(toolbar =>
                {
                    toolbar.Create();
                })
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .Batch(true)
                    .PageSize(20)
                    .ServerOperation(false)
                )
            )

     

    However, when attempting to save the row, the grid is failing as it is attempting to trigger a POST action - it does not appear to be respecting the Batch edit mode.

    The reason for I am trying this is that using InCell editing it is letting me complete a row without actually triggering all client side validation. For example, using InCell editing:

    • Click Add New Record
    • New row added, Scale cell selected in first column - client side validation enabled for this
    • I can complete this cell and then Add the row to the datasource - without the validation being triggered for the second cell in the Page No column.

    This is not ideal - using Inline editing, whole row goes into edit mode and all client side validation is triggered. Can you advise if this mode is supported with batch editing and if not, is there a suitable workaround you could suggest?

     

    Thanks

  2. Tsvetomir
    Admin
    Tsvetomir avatar
    838 posts

    Posted 17 Feb Link to this post

    Hi Paul,

    Thank you for the provided snippet and clarifications. 

    At present, the batch editing of the grid is available only for the InCell edit mode. This is due to the fact that the Update button for the inline edit will internally call the sync() method. Hence, after every update (even though batch is enabled) it will send only one item to the server.

    Is there a specific reason why the InCell edit mode is not suitable in your case? 

    I am afraid that we have no immediate plans to enable the batch editing with InLine edit mode out-of-the-box. However, you could log an item in our feedback portal:

    https://feedback.telerik.com/kendo-jquery-ui

     

    Kind regards,
    Tsvetomir
    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 https://learn.telerik.com/.

  3. Paul
    Paul avatar
    7 posts
    Member since:
    Dec 2019

    Posted 17 Feb in reply to Tsvetomir Link to this post

    Thanks for the response.

    I stated the reason above:

    The reason for I am trying this is that using InCell editing it is letting me complete a row without actually triggering all client side validation. For example, using InCell editing:
    Click Add New Record
    New row added, Scale cell selected in first column - client side validation enabled for this
    I can complete this cell and then Add the row to the datasource - without the validation being triggered for the second cell in the Page No column.

     

    Basically, it's a confusing user experience. The validators are only triggered for the second column cell if you click on it before clicking add.

     

  4. Tsvetomir
    Admin
    Tsvetomir avatar
    838 posts

    Posted 17 Feb Link to this post

    Hi Paul,

    I apologize for missing out that the main point for not using the InCell edit mode is the validation. It is correct that the validation is done only over the input HTML elements and no over the actual values of the model. 

    As a proof of concept, I have prepared a sample where custom validation is executed for the grid whenever the user attempts to submit the changes:

    https://dojo.telerik.com/erOpOTuw

    Evaluate the example above and let me know if that is applicable in your scenario.

     

    Kind regards,
    Tsvetomir
    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 https://learn.telerik.com/.

Back to Top