How to delete a row in my grid

1 Answer 3198 Views
Button Grid
Emna
Top achievements
Rank 1
Emna asked on 28 Apr 2022, 01:26 PM

I actually have a grid, in every column there's a delete button and when clicking on it, it has to remove the row.

Even though i used" kendoGridRemoveCommand" in the code below, nothing is working: 

<kendo-grid-command-column title="Command">
        <ng-template kendoGridCellTemplate >
            <buttonkendoGridRemoveCommand icon="delete" style="color: red;"></button>
        </ng-template>
    </kendo-grid-command-column>

1 Answer, 1 is accepted

Sort by
1
Accepted
schakravarty
Top achievements
Rank 2
Iron
Iron
answered on 28 Apr 2022, 06:23 PM
So in the grid definition you need 
<kendo-grid       
        (remove)="onRemoveClicked($event)"              
    >
then the onRemoveClicked event handler will pass you the information you need to do complete removing it. See the documentation examples at https://www.telerik.com/kendo-angular-ui/components/grid/editing/editing-reactive-forms/
Martin Bechev
Telerik team
commented on 03 May 2022, 07:31 AM

Hi Emna, Paul,

In general, the command directives are used to trigger the built-in events of the Grid  - kendoGridRemoveCommand triggers remove event, kendoGridAddCommand triggers add an event, and so on. But the logic for removing, adding, or processing any other CRUD operations is left in the hands of the developer.

Emna
Top achievements
Rank 1
commented on 11 May 2022, 09:10 AM

Hello,

thanks a lot it was really helpful !

Tags
Button Grid
Asked by
Emna
Top achievements
Rank 1
Answers by
schakravarty
Top achievements
Rank 2
Iron
Iron
Share this question
or