Reputation: 5901
I can't find any good information on how to place a combobox inside a cell in a wxgrid. I tried Google, but maybe I'm blind. Anyone have a simple sample to share?
Upvotes: 4
Views: 4251
Reputation: 3883
Take a look at GridChoiceCellEditor. You can use it as follows:
choice_editor = wx.grid.GridCellChoiceEditor(choices_list, True)
grid.SetCellEditor(row, col, choice_editor)
Upvotes: 5
Reputation: 33111
The wxPython demo has an example that shows how this is done in the GridStdEdRend.py file itself or from within the demo itself, see the "Editors and Renderers Demo" part of the grid demo. What you're looking for is the GridCellChoiceEditor. See also: http://wiki.wxpython.org/GridCellChoiceEditor
Upvotes: 1