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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Commands only working on first grid item

Thread ID:





130143 Apr 25,2017 12:30 AM UTC Apr 25,2017 04:43 PM UTC Angular 2
Tags: ejGrid
Asked On April 25, 2017 12:30 AM UTC

<ej-grid id="marketingGrid"
[editSettings]=" { allowAdding: 'true', allowDeleting: 'true', allowEditing: 'true' }"
[filterSettings]="{ filterType: 'excel' }"
<e-column field="retailPrice" headerText="Retail Price" format="{0:C}" textAlign="left" width=140></e-column>
<e-column field="specialPrice" headerText="Special Price" format="{0:C}" textAlign="left" width=140></e-column>
<e-column [commands]="editCommand" headerText="Edit" textAlign="center" width=40></e-column>
<e-column [commands]="removeCommand" headerText="Remove" textAlign="center" width=55></e-column>

this.removeCommand = [
type: ej.Grid.UnboundType.Delete,
buttonOptions: {
contentType: "imageonly",
size: "normal",
prefixIcon: "mi"

this.editCommand = [
type: ej.Grid.UnboundType.Edit,
buttonOptions: {
contentType: "imageonly",
size: "normal",
prefixIcon: "mi mi-mode-edit",

I have a grid as the above with those commands and whenever I go to use them they work but only on the first item in the dataSource. When I log the beginEdit it gets the right row but then displays the first row in the UI and edits that one. To clarify, the positioning stays the same,and the first row still has it's item but the row that is in the process of editing also has a copy of it.

Replied On April 25, 2017 12:47 AM UTC

Attached an example image to fully clarify what I mean
Attachment: Screenshot__4_24_2017_,_8_43_56_PM_ver001_155f9f92.zip

Thavasianand Sankaranarayanan [Syncfusion]
Replied On April 25, 2017 04:43 PM UTC

Hi Zack, 

We have analyzed your query and we suspect that you want to do CRUD operations in Grid but while editing the record first record value gets shown in other records editing. 

If Grid columns does not have primaryKey column then CRUD operations are not properly working. CRUD operations are performed based on the primaryKey column in Grid. So, you need to enable isPrimaryKey property in any one of the column, which has unique values. 

Refer the below code example. 

<ej-grid id="Grid23" [allowPaging]="true" > 
            <e-column field="EmployeeID"  headerText="Employee ID" textAlign="right"></e-column> 
            <e-column field="OrderID" [isPrimaryKey]="true"  headerText="Order ID" textAlign="right"></e-column> 
            <e-column field="CustomerID" headerText="Customer ID" textAlign="right"></e-column> 

Refer the help documentation. 

Thavasianand S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon