In most cases, you won't have to write code to add or remove rows from the grid. By default, it will have one row of column headers and one row per bound item (added automatically when you set the grid's itemsSource property.
If you want to allow users to add or remove rows at runtime, use the following properties:
The grid below shows how this works:
import * as wjGrid from '@grapecity/wijmo.grid';
// generate some random data
var countries = 'US,Germany,UK,Japan,Italy,Greece'.split(','),
data = [];
for (var i = 0; i < countries.length; i++) {
data.push({
id: i,
country: countries[i],
downloads: Math.round(Math.random() * 20000),
sales: Math.random() * 10000,
expenses: Math.random() * 5000
});
}
//enable allowAddNew and allowDelete in the FlexGrid
var theGrid = new wjGrid.FlexGrid('#theGrid', {
itemsSource: data,
allowAddNew: true,
allowDelete: true
});