disable selection in wxGrid?

disable selection in wxGrid?
From Mon, 2 Apr 2001, titled “wxGrid Questions”

Replies are from Robin

···

+++++++++++++

  • Created an “OnSelect” handler, and called it using

EVT_GRID_SELECT_CELL(self, self.OnSelect) (where ‘self’ is a wxGrid

subclass).

As well as responding to clicks on checkboxes, the OnSelect handler

deliberately

does not call event.Skip(). This means that cell-selection events don’t

get

processed, so cells never get selected…in theory.

Sounds like trying to pound a (large) square peg into a (small) round hole.

I’m not surprised that it’s acting weird since the wxGrid’s designers

probably never thought it would be used this way.

Any and all suggestions would be most welcome!

As Mike said, unless the number of rows is very large it probably makes more

sense to put the [static text and checkBox] controls directly on a wxPanel or

wxScrolledWindow and use a wxFlexGridSizer to handle layout.

++++++++++++

I have a similar application of the Grid – displaying data only and don’t want the user to be able to select

cells, rows, or cols.

Is there a way to disable selection completely? Or is Robin’s final paragraph still the best advice?

Thanks

Bruce