export class AppComponent {
ngAfterViewInit(){
this.Grid.widget.columns("OrderID", "remove"); // remove grid column
this.Grid.widget.columns("OrderID", "add"); // Add new column into grid or modified already existing column in the grid.
}
@ViewChild('grid') Grid: EJComponents<any, any>
; // Create grid instance.
} |
Hi Nikhil,
Thank you for contacting Syncfusion support.
We suggest you to use columns method of ejGrid to add/remove/update the columns dynamically in Grid. Please refer to the below help document, code example.
export class AppComponent {ngAfterViewInit(){this.Grid.widget.columns("OrderID", "remove"); // remove grid columnthis.Grid.widget.columns("OrderID", "add"); // Add new column into grid or modified already existing column in the grid.}@ViewChild('grid') Grid: EJComponents<any, any>; // Create grid instance.}
Also, we have already discussed same in the following knowledge base document,
Regards,
Jayaprakash K.
<ej-grid [allowPaging]="true" [pageSettings.pageSize]="pagesize" [dataSource]="gridData">
</ej-grid>
export class GridComponent {
public gridData: any;
public pagesize: number;
constructor() {
this.gridData = [{"name": "Malaysia","Sep 2015": 38,"Oct 2015": 35,"Nov 2015": 29,"Dec 2015": 26,"Jan 2016": 49,"Feb 2016": 43,"Mar 2016": 52,"Apr 2016": 59,"May 2016": 33,"Jun 2016": 35,"Jul 2016": 26,"Aug 2016": 27,"Sep 2016": 60}];
this.pagesize = 5;
}
} |
|