We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Delete button on Toolbar

Hello, 

I have implemented the Delete button of the Toolbar and when I choose with a checkbox, for example, the fifth row and I press the button it deletes the first row not the fifth one. Here is the code:

editSettings: EditSettingsModel;
toolbar: ToolbarItems[] | Object;
@ViewChild('grid')
grid: GridComponent;

constructor(private time: Time) {
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true };
this.toolbar = [ 'Delete'];
}

<ejs-grid #grid [dataSource]='dataDelete' [editSettings]='editSettings' [toolbar]='toolbar' (actionComplete)="onActionComplete($event)">
<e-columns>
<e-column type='checkbox' width='70'></e-column>
<e-column ----------------------------------------></e-column>
<e-column ----------------------------------------></e-column>
</e-columns>
</ejs-grid>

Looking forward to hearing from you, 

Ane Perez de Nanclares

3 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team January 29, 2019 10:08 AM UTC

Hi Ane, 

Greetings from Syncfusion. 

Based on your detail we suspect that first record gets deleted when we select any other one in Grid. This issue may cause of isPrimaryKey column is not defined in Grid. we have already discuss about the above mention query in the following documentation. 


Regards, 
Thavasianand S. 



AN Ane January 29, 2019 01:19 PM UTC

Thank you!


TS Thavasianand Sankaranarayanan Syncfusion Team January 30, 2019 03:59 AM UTC

Hi Ane, 
 
We are happy that the problem has been solved. 
 
Please get back to us if you need any further assistance.  
                          
Regards, 
Thavasianand S.

Loader.
Live Chat Icon For mobile
Up arrow icon