@Component({
selector: 'app-root',
template: ` <ejs-grid [dataSource]='data' [editSettings]='editSettings'>
<e-columns>
<e-column field='CustomerID' headerText='Customer ID' width=150>
<ng-template #template let-data>
<span>{{data.CustomerID}}</span> // you can show the initial value like this.
<div style='width: 150px'>
<ejs-dropdownlist id='ddlelement' [dataSource]='dropData' ></ejs-dropdownlist>
</div>
</ng-template>
</e-column>
</e-columns>
</ejs-grid>`,
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
public data: object[];
public dropData: any;
public editSettings: EditSettingsModel;
ngOnInit(): void {
this.data = data;
this.dropData = ['VINET', 'TOMSP', 'HANAR', 'SUPRD', 'VICTE'];
this.editSettings = { allowEditing: true, allowDeleting: true };
}
} |