Demos
Documentation
API
More Samples
Download Wijmo

Adding and Removing Rows

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:

  • allowAddNew: Setting this property to true causes the grid to show a new row 'template' at the bottom of the grid. Users may add new rows to the itemsSource array by filling out the cells in the new row template.
  • allowRemove: Setting this property to true causes the grid to handle the 'Delete' key and remove selected rows. Users may click row headers to select the row, then press 'Delete' to remove the bound items from the itemsSource array.
  • newRowAtTop: Setting this property to true causes the grid to show the new row template at the top of the grid rather than at the bottom.

The grid below shows how this works: