Search code examples
c++wxwidgetswxgrid

wxWidgets: Delete content of wxGrid cells by selecting and pressing DEL?


By default a wxGrid acts like that: If a cell or multiple cells are selected and DEL/Backspace is pressed, the cursor jumps into the (first) cell selected and deletes the first character in that cell.

Is it possible to have an Excel - like behaviour in that when this action is performed, the whole content of the cell(s) is deleted?


Solution

  • Just handle wxEVT_CHAR for wxGrid yourself and clear the cell contents when you get an event for one of those keys.