This is a migrated thread and some comments may be shown as answers.

.NET Core Grid - Batch with Inline Edit

3 Answers 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Veteran
Paul asked on 12 Feb 2021, 10:12 AM

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

3 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 17 Feb 2021, 09:46 AM

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/.

0
Paul
Top achievements
Rank 1
Veteran
answered on 17 Feb 2021, 09:48 AM

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.

 

0
Tsvetomir
Telerik team
answered on 17 Feb 2021, 04:34 PM

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/.

Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Veteran
Answers by
Tsvetomir
Telerik team
Paul
Top achievements
Rank 1
Veteran
Share this question
or