Niclas Nilsson
Niclas Nilsson

Reputation: 5901

How to place a combobox in wxgrid (python)?

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

Answers (2)

Vader
Vader

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

Mike Driscoll
Mike Driscoll

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

Related Questions