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

In cell edit custom update/decline changes button

3 Answers 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Cooler
Top achievements
Rank 1
Veteran
Cooler asked on 13 Oct 2020, 06:18 PM
Hi, is it possible to customize in-cell editing. I need to save changes when a button is clicked inside cell in edit mode. Like in screenshot below
 

3 Answers, 1 is accepted

Sort by
0
Accepted
Martin
Telerik team
answered on 15 Oct 2020, 07:32 AM

Hi,

Thank you for the screenshot.

In order to customize a cell content when it is in edit mode, use kendoGridEditTemplate:

 

            <kendo-grid-column field="ProductName" title="Product Name">
               <ng-template kendoGridEditTemplate
                let-dataItem="dataItem"
                let-formGroup="formGroup">
               <input/> 
               <button>Save</button>
              </ng-template>
            </kendo-grid-column>

 

For more details check this article where the template is used in reactive form:

https://www.telerik.com/kendo-angular-ui/components/grid/editing/custom-reactive-editing/#toc-custom-editing-in-reactive-forms

I hope this helps.

Regards,
Martin
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Cooler
Top achievements
Rank 1
Veteran
answered on 15 Oct 2020, 12:02 PM
Thanks for the answer. But I need the ability to edit on click in a cell. I don't know how to save the change by clicking the save or cancel button inside the cell, rather than losing focus as shown in the screenshot.
0
Martin
Telerik team
answered on 19 Oct 2020, 09:47 AM

Hi,

To save the new cell value, the developer needs to handle manually the click event if the desired buttons, and implement custom logic that will update the Grid value cells.

Please check the following example where the Grid automatically saves the new value, using the built-in save the event.

https://www.telerik.com/kendo-angular-ui/components/grid/editing/in-cell-editing/

Using save method is not an option, since a custom button should save the new value, but the used logic is the same.

To control the edit mode of a cell use, editCell and closeCell methods.

Regards,
Martin
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
Cooler
Top achievements
Rank 1
Veteran
Answers by
Martin
Telerik team
Cooler
Top achievements
Rank 1
Veteran
Share this question
or