Delete Rows with Ctrl+Delete
You can handle keyboard events in the FlexGrid by adding HTML event listeners to hostElement of the grid.
For example, the grid below listens to the 'keydown' event. If you press Ctrl+Delete, it shows a prompt and deletes the current row. Note that:
- The event listener is added with the capture parameter set to true, so that it is called before the grid gets it.
- The event handler calls the event's preventDefault method, so that the grid does not handle the Delete key as it normally would.
Press Ctrl+Delete to remove the current row: