Grid has a dropdown column type, selecting a value in that dropdown can update the dropdown values in the same column for other rows. However, whenever updating the grid's datasource via dropdown's change event, everything works as expected except that the grid control adds a new record row at the top of the grid. The grid is set to allowAdding:false. How do I prevent the grid from creating that new record row. The grid edit params and dropdown edit params are set in the page oninit(). The grid and column are set up as follows:
Grid is defined as
<ejs-grid class="grid" #grid [dataSource]="localParams.linkedAccounts" (dataBound)="onGridDataBound($event)" (rowSelected)="rowSelected($event)" (load)='load($event)' (cellSave)="onCellSave($event)" (actionComplete)='onActionComplete($event)' (actionBegin)='actionBegin($event)'
(created)="onGridCreated()" [editSettings]='editSettings' [selectionSettings]="selectionOptions" [allowPaging]='false'>
this.editSettings = {allowEditing:true, allowAdding:false, allowDeleting: false, mode: "Normal" };
Primary Key column
<e-column field='accountNumber' isPrimaryKey="true" headerText='Account Number' clipMode='EllipsisWithTooltip'>
And a dropdown grid column defined as follows
<e-column [edit]="ddParams" field='relationshipType' headerText='Designation' foreignKeyField="value" foreignKeyValue="text" [dataSource]="accountDesignations">e-column>
this.ddParams = {
params: {
actionComplete: (args: any) =>
{
if(this.currentSelectedRow){
if(this.currentSelectedRow.accountTypeId==2){
args.result = this.ccAccountDesignations;
}
}
},
change: (args: ChangeEventArgs)=>{
var row = this.grid.dataSource[4] as Dto;
row.relationshipType = '';
this.grid.updateRow(4, row);
};