Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable multi selection in a wxGrid?

Tags:

wxwidgets

I want to select only one row in wxGrid. Is is possible to disable multiselection in a wxGrid? I tried SetSelectionMode, it helps me to select only rows. But I cannot use it for single row selection.

like image 210
fat Avatar asked Nov 17 '25 01:11

fat


1 Answers

Capture the wxEVT_GRID_SELECT_CELL event.

Use GetSelectedRows() to obtain an array of selected rows.

If there are more than one row selected -

  • Use SelectRow() to deselect everything except, say, the first row in the array.
like image 167
ravenspoint Avatar answered Nov 21 '25 10:11

ravenspoint